Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jadonk/e88f124321d7ea392066257a2b155d5c to your computer and use it in GitHub Desktop.
Save jadonk/e88f124321d7ea392066257a2b155d5c to your computer and use it in GitHub Desktop.
mikroBUS over Greybus BeagleConnect Freedom Demo

Seeed BeagleBone® Green Gateway host

When it comes to hardware setup, there is a fair bit of handwaving below. It is assumed for now you can figure out how to connect the antennas to the BeagleConnect Freedom boards and other similar hardware configuration steps.

OS Image for BeagleBone/PocketBeagle from SD card

  1. Download the special mikroBUS/Greybus BeagleBoard.org Debian image from here.
  2. Load this image to a microSD card using a tool like Etcher.
  3. Insert the microSD card into the Green Gateway.
  4. Power the Green Gateway via the 12V barrel jack.
  5. Use Ethernet via a cable or WiFi via connmanctl for an Internet connection.

Flash BeagleConnect Freedom gateway device

On the newly imaged BeagleBone Green Gateway board, using the latest firmware release

  1. wget https://github.com/jadonk/beagleconnect/releases/download/bcf-beta0.0.7/bcf-bcf-beta0.0.7.zip
  2. unzip bcf-bcf-beta0.0.7.zip && cd build
  3. Connect (or reconnect) a BeagleConnect Freedom board over USB
  4. chmod +x cc2538-bsl.py
  5. ./cc2538-bsl.py cc1352/wpanusb_beagleconnect.bin /dev/ttyACM0
  6. After it finishes programming successfully, reconnect the BeagleConnect Freedom board over USB
  7. Test that the driver loaded and is talking to the newly added gateway radio
debian@beaglebone:~$ iwpan wpan0 info
Interface wpan0
        ifindex 10
        wpan_dev 0x200000001
        extended_addr 0x5a4f745eb7beac7f
        short_addr 0xffff
        pan_id 0xffff
        type node
        max_frame_retries 3
        min_be 3
        max_be 5
        max_csma_backoffs 4
        lbt 0
        ackreq_default 0

Test gateway using pre-programmed node firmware

By default, the beta boards ship with a debug sensor broadcast per https://gist.github.com/Pillar1989/c579b789e38e856cde16e77345932ac4. You can use this to further test your gateway.

  1. Power a BeagleConnect Freedom that has not yet been programmed via a USB power source, not the BeagleBone Green Gateway. You'll hear a click every 1-2 seconds along with seeing 4 of the LEDs turn off and on.
  2. In an isolated terminal window, sudo beagleconnect-start-gateway
  3. wget https://raw.githubusercontent.com/jadonk/beagleconnect/master/sw/sensortest-rx.py
  4. chmod +x sensortest-rx.py
  5. ./sensortest-rx.py

Every 1-2 minutes, you should see something like:

('fe80::3111:7a22:4b:1200%lowpan0', 52213, 0, 13)  '2l:7.79;'
('fe80::3111:7a22:4b:1200%lowpan0', 52213, 0, 13)  '4h:43.75;4t:23.11;'

The value after "2l:" is the amount of light in lux. The value after "4h:" is the relative humidity and after "4t:" is the temperature in Celcius.

Flash BeagleConnect Freedom node device

Do this from the BeagleBone Green Gateway board that was previously used to program the BeagleConned Freedom gateway device:

  1. Disconnect the BeagleConnect Freedom gateway device
  2. Connect a new BeagleConnect Freedom board via USB
  3. ./cc2538-bsl.py cc1352/greybus_mikrobus_beagleconnect.bin /dev/ttyACM0
  4. After it finishes programming successfully, disconnect the BeagleConnect Freedom node device
  5. Power the newly programmed BeagleConnect Freedom node device from an alternate USB power source
  6. Reconnect the BeagleConnect Freedom gateway device to the BeagleBone Green Gateway
  7. sudo beagleconnect-start-gateway

Common firmware build script

cd /opt/source
sudo chmod go+w .
git clone https://github.com/jadonk/beagleconnect --recurse-submodules
cd ..beagleconnect/sw <if not cloned already, clone beagleconnect repo with submodules>
./build-firmware.sh

To skip this step, download the pre-built firmware from : https://github.com/jadonk/beagleconnect/suites/4055985525/artifacts/102934099

@vaishnavachath
Copy link

@jadonk can we update the commit for greybus to f7fe50f8c0ab4545a0850e0552b99ad7522287b8

this was a miss from my side while copy pasting the commit :

git clone https://github.com/jadonk/greybus.git
cd greybus
git checkout f7fe50f8c0ab4545a0850e0552b99ad7522287b8

@jadonk
Copy link
Author

jadonk commented Nov 1, 2021

hmmm.... this is already the commit ID I have on the head of jadonk/beagleconnect

@jadonk
Copy link
Author

jadonk commented Nov 1, 2021

@Vaishnav98 you mention a different greybus commit earlier.

@jadonk
Copy link
Author

jadonk commented Nov 1, 2021

@Vaishnav98 I think the binary image you pointed to isn't a complete build.

@jadonk
Copy link
Author

jadonk commented Nov 2, 2021

@Vaishnav98 what do I flash into a board where I just want the manifest to describe the default, built-in sensors? LISx, OPTx and HDSx?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment