- use 255a5cd as earliest version for fixed duplicate address detection
- Channel:
DEFAULT_CHANNEL=19
- Number of display LEDs:
LUKE_DISPLAY_CNT=64
- Start Raspberry Pi with IEEE 802.15.4 radio connected to monitor with
following services
lowpan
aiocoap-rd
listening on 6LoWPAN interface generated bylowpan
servicenginx
pointing root to./webfrontend
- [
./coap_service/coap_service.py
] withaiocoap-rd
address and configured root ofnginx
- start dino
- start controller
- start display
- if all nodes appear in the web frontend the demo is basically set-up
- Drag nodes around to set their targets
- reload page (button is supposed to at one point)
- reset node manually
- if it still does not appear: reboot the whole demo (red button top right). Wait until the page refreshes (may take several seconds) then reset the node manually
¯\_(ツ)_/¯
... Reboot demo?
- Difficulty (= decrement interval) can be set with the SWD0 button of th SAMR21-XPRO of the display
- LEDs will show the new difficulty level (the more LEDs the more difficult)
- Default difficulty is 9 of 10
- The demo is based on CoAP and CoRE-RD
- Nodes have to register their resources with the resource directory
- Nodes identify themselves to the frontend using a section of their path
<id>
/dino
=> dino/btn
=> controller/dsp
=> display
- To configure the target of an action (button pressed, game won, ...) a node
needs to have a POST-able target
/<id>/target
- Expects a JSON object with:
addr
: the address + port (optional) part of a CoAP-URL (e.g.[2001:db8::1]
or[2001:db8::2]:5678
) as stringpath
: the path part of a CoAP-URL (e.g./dsp/points
) as string
- The configured target needs to be able to handle POSTed JSON objects
with:
points
: an integer
- The frontend expects those targets to be of the format
/<id>/points
- Expects a JSON object with:
- All nodes should have a POST-able resource
/reboot
to reboot the node
Currently the demo has 3 nodes
- Resources:
/btn/target
(POST / GET) (see Background):- GET: currently configured target
- POST: configures target of the button
/reboot
(POST): reboots the node
- Sends a POST request to its configured target every 100ms
points
will be the number of button presses since the last POST request
- Resources:
/dsp/points
(POST / GET):- GET (observable): JSON object with
points
: current points counter as integer
- POST: Expects JSON object with
points
: number of points to increment points counter
- GET (observable): JSON object with
/dsp/target
(POST / GET) (see Background)- GET: currently configured target
- POST: configures target of the button
/reboot
(POST): reboots the node
- Sends a POST request to its configured target on victory condition
(5 times received to
/dsp/points
to get points counter to the maximum)points
will be the current points counter as integer
- Resources:
/dino/points
(POST): JSON object withpoints
: integer, if > 0 the dino moves
/reboot
(POST): reboots the node
- make sure they follow the parameters set in Background
- extend
get_node_name()
inwebfrontend/js/luke.js
with the identifying URL part - add new node name to
NODES_ORDERED
inwebfrondend/js/luke.js
- create a
<node_name>.html.part
representing the widget inwebfrontend/js/luke.js
- extend
get_resource_name()
inwebfrontend/js/luke.js
- extend if necessary:
get_handlers
,obs_handlers
,post_handlers
inwebfrontend/js/luke.js
- add capability for custom POST success handlers to CoAPResource.post() if necessary