The goal is to be able to flash a beaglebone, plug into a device (edu board, germ/smhz NVS), turn on, then navigate to UI page in order to setup the static IP + public URL, register the device on the backend (and show code to user), and specify device config file.
Requires pre-config wifi credentials stored on image
Need to make this general case.
Perhaps use a wifi.json file that is untracked in GH
Starting to get too much config in project root, perhaps shift dir structure to:
/openag-device-software
/config
about.json
wifi.json
/templates
about.json
wifi.json
Specify .gitignore to include /config/templates but not /config/*.json
Requires brain + http tunnelling to run at startup
Brain needs to not quit if not registered on backend
A good paradigm is that if bbb is on, jbrain is running and accessible publically
Requires default public url addressing scheme
How do we know the public URL of the device UI once initially turned on?
Perhaps basic script that tries dev.register.1.serveo.net
If dev.register.1 is taken, try dev.register.2, etc.
Would be nice to have some feedback mechanism to verify which device is being provisioned
Perhaps detect device type, if BBB, flash user LEDs
Not sure how to handle alternative single board computers (e.g. Raspberry Pi) but can look for similar mechanism.
This mechanism should be a "signal" button in the developer UI registration tab hits the signal endpoint that is passed data = {"on": true} or data={"on": false"}
The blinking of the user LEDs should be spawned as a thread..but where should we keep the thread handler object? (the endpoint is stateless)...
Kind of gross but we could just not hold the thread handle, search for process name, then kill it...ewww
Best course of action is likely to create a "UserLED" as a "default" peripheral of sorts (e.g. user should never have to specify it in device config file) that behaves more like recipe / device manager thread that can be signaled to turn on/off. Need to think through this a bit more.
Brain now always runs even if there is no network connection or IoT registration. I think we should ship with out either and let the user configure it themselves with the new Connect UI page.
Do we need a static IP, now that Jake has autossh and serveo.net working? The new connect logic (using scripts/connect_wifi.sh) will retstart autossh when wifi is changed.
The goal is to be able to flash a beaglebone, plug into a device (edu board, germ/smhz NVS), turn on, then navigate to UI page in order to setup the static IP + public URL, register the device on the backend (and show code to user), and specify device config file.
Requires pre-config wifi credentials stored on image
Requires brain + http tunnelling to run at startup
Requires default public url addressing scheme
dev.register.1.serveo.net
dev.register.1
is taken, trydev.register.2
, etc.Would be nice to have some feedback mechanism to verify which device is being provisioned
registration
tab hits the signal endpoint that is passed data = {"on": true} or data={"on": false"}