Hi,
New to Digi kit but not networking. I`ve tried to find info on my own but I’m struggling. Lack of know-how, correct direction, docs. Can you please help.
Using Python script from Digi wiki
I have a brand new Connect Port X4 and an AIO with a 4 to 20 mA thermocouple on Terminal 1 to measure temp in degrees. I want to run a python script and return an appropriate value to STDOUT etc.
I have run the following to set to Current Loop (4-20mA) and analog input on terminal 1 & 2
from xbee import ddo_get_param, ddo_set_param
addr = ‘[00:13:a2:00:40:98:17:29]!’
##Enabling current loop on terminals 1 and 2
ddo_set_param(addr, ‘D8’, 4)
ddo_set_param(addr, ‘D4’, 4)
ddo_set_param(addr, ‘D6’, 4)
##Enabling terminals 1 and 2 for analog input
ddo_set_param(addr, ‘D0’, 2)
ddo_set_param(addr, ‘D1’, 2)
Changes applied using:
##Applying changes and writing to flash
ddo_set_param(addr, ‘AC’)
ddo_set_param(addr, ‘WR’)
To obtain value I use:
##Taking a sensor sample, printing the raw binary string to STDOUT
sample = ddo_get_param(addr, ‘IS’)
print sample
Return is always: 9Ðùÿ
Appears Malformed?
Using http://www.roubaixinteractive.com/PlayGround/Binary_Conversion/Binary_To_Text.asp converts to
00111001110100001111100111111111
Do I parse and take the decimal number?
Value never changes although ohms on terminal Pair does
Two issues:
- How can I retrieve convert to meaning full data? Spent a day looking at digi docs and forums but struggling.
- Why is value constant when temperature is not?
Points:
• Documentation in detail appears limited unless I’m looking in the wrong place.
• Thermocouple tested and records values fine on Siemens 1200. I`ve also tested Terminal 1 positive and negative on multimeter and appears ok as in fluctuates ohms when temp applied/taken away.
• I wonder if I have set it up correctly?
Can anybody help or point in correct direction.
Many thanks
Aidan