...
Tip |
---|
The D0 GPIO corresponds to the |
Tip |
---|
To fill in the table below, take a look at the SmartMesh IP Tools Guide, chapter "On-Chip Application Protocol" |
Fill in the following table to create the command to send to the mote to enable the digital_in/D0 GPIO:
...
field name
...
length
...
value
...
explanation
...
control byte
...
1 byte
...
05
...
N.A.
...
id byte
...
1 byte
...
00
...
N.A.
...
command
...
1 byte
Info | ||||
---|---|---|---|---|
| ||||
look for the "Command field" table in the tools guide |
...
PUT
...
channel
...
type
...
1 byte
...
ff
...
type: address
...
length
...
1 byte
...
02
...
...
value
...
2 bytes
Info | ||||
---|---|---|---|---|
| ||||
look for the "Addressable Elements and Pinout" list in the tools guide |
...
create a flow which issues:
- an HTTP PUT request
- to URL http://127.0.0.1:8080/api/v1/oap/{{mote}}/digital_in/D0
...
length
...
1 byte
...
01
...
value
...
1 byte
Info | ||||
---|---|---|---|---|
| ||||
look for the "/digital_in" section in the tools guide, variable "enabled" |
...
enabled
Issue the command to your mote:
...
macAddress
...
your mote’s MAC address, e.g. 00170D0000600382
...
priority
...
Medium
...
srcPort
...
61625
...
dstPort
...
61625
...
options
...
0
...
data
...
<see above>
Read the value of the D0 GPIO
Tip |
---|
To fill in the table below, take a look at the SmartMesh IP Tools Guide, Chapter "On-Chip Application Protocol" |
Fill in the following table to create the command to send to the mote to read the current value on digital_in/D0 GPIO:
...
field name
...
length
...
value
...
explanation
...
control byte
...
1 byte
...
05
...
N.A.
...
id byte
...
1 byte
...
00
...
N.A.
...
command
...
with payload
...
ID
...
1 byte
Info | ||||
---|---|---|---|---|
| ||||
look for the "/digital_in" section in the tools guide, variable "enabled" |
...
type: enable
Code Block { sampleCount: 1, rate: 10000, enable: 1, dataFormat: 0 }
Open the SmartMesh IP Tools Guide (http://www.linear.com/docs/42453), looks for section "/digital_in". What does dataFormat 0 mean?
Info icon false title Answer
...
1:
...
look for the "Command field" table in the tools guide
...
GET
...
channel
...
type
...
1 byte
...
ff
...
type: address
...
length
...
1 byte
...
02
...
...
value
...
2 bytes
Info | ||||
---|---|---|---|---|
| ||||
look for the "Addressable Elements and Pinout" list in the tools guide |
...
Read the value of the D0 GPIO
...
icon | false |
---|---|
title | Answer 17.7: |
...
field name
...
length
...
values received
...
explanation
...
control byte
...
1 byte
...
N.A.
...
id byte
...
1 byte
...
N.A.
...
command
...
1 byte
...
return code
...
1 byte
...
channel
...
type
...
1 byte
...
length
...
1 byte
...
value
...
2 bytes
...
variable
...
type
...
1 byte
...
length
...
1 byte
...
value
...
1 byte
...
variable
...
type
...
1 byte
...
length
...
1 byte
...
value
...
4 bytes
...
variable
...
type
...
1 byte
...
length
...
1 byte
...
value
...
2 bytes
...
variable
...
type
...
1 byte
...
length
...
1 byte
...
value
...
1 byte
...
variable
...
type
...
1 byte
...
length
...
1 byte
...
value
...
1 byte
create a flow which issues:
- an HTTP GET request
- to URL http://127.0.0.1:8080/api/v1/oap/{{mote}}/digital_in/D0
- Issue the command to your mote :
macAddress | your mote’s MAC address, e.g. |
---|---|
priority | Medium |
srcPort | 61625 |
dstPort | 61625 |
options | 0 |
data | <see above> |
...
Fill in the following table with the bytes you receive. Start by filling in the "values received" column by directly copy-pasting the bytes. Then, use the tools guide to fill in the "explanation" column.
What is the state (value) of your pin?
Info icon false title Answer 17.82: Connect a jumper between the
DP2
andVSUPPLY
pins. Make sure you can read the value of digital_in/D0 to be high.Connect a jumper between the
DP2
andGND
pins. Make sure you can read the value of digital_in/D0 to be low.Warning NEVER CONNECT
VSUPPLY
ANDGND
TOGETHER!!