1

I bought the Slice of Radio and a couple of wireless thermometers (all 868MHz) from Wirelessthings, that unfortunately went out of business at the same time I got the stuff and now their website is also not working.

I installed the Slice of Radio on a Raspberry Pi Model B+. All example images online show it with the original 26-pin Raspberry Pi (example). I just slid in on the first 2x13 pins from the corner. I managed to upgrade the firmware on the radio board so maybe the pins are correct. The heart beat led on the board is blinking.

I also bought a couple of the LB-CA temperature and humidity sensor. I have followed the guidelines on how to setup the radio and the sensors. Everything is working as documented except that when I'm pressing the config button on the sensor, nothing happens on the Raspberry.

I also flashed the Slice of Radio with the newest firmware from here. Before that I couldn't connect to the radio board with the MessageBridge software specified in the guide mentioned above.

I'm not so familiar with wireless connections but I ran the following script

 #!/usr/bin/env python

import serial

ser = serial.Serial(
   
    port='/dev/ttyAMA0',
    baudrate = 9600,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    bytesize=serial.EIGHTBITS,
    timeout=1
)         

while 1:
    x=ser.readline()
    print x

This produced nothing, even when I was pushing the button on the sensor. I bought several sensors and I can't this working with any of them.

My questions:

  1. Is it ok to put the Slice of Radio on the first 2x13 pins on a model B+ Raspberry Pi or do I need to change some setting.
  2. A led is flashing in the sensors and I assume they are sending on the 868MHz frequency stated on them. Should this traffic be somehow seen on the Raspberry running the above script, indicating that there is some transmission going on?
  3. Any pointers as to what is the problem.

More debug information

In MessageBridge.cfg I have

[Serial]
network_use_radio_serial_number = False
network = Serial
baudrate = 9600
port = /dev/ttyAMA0
at_gpio = False
at_gpio_pin = 16

When starting MessageBridge with python MessageBridge.py -d -l DEBUG I get:

2016-10-02 18:34:28,314 - Message Bridge - INFO - Serial port init

2016-10-02 18:34:28,327 - Message Bridge - INFO - tSerial: Serial thread started

2016-10-02 18:34:29,327 - Message Bridge - INFO - DCR Thread init

2016-10-02 18:34:29,334 - Message Bridge - INFO - tSerial: Opened the serial port

2016-10-02 18:34:29,347 - Message Bridge - INFO - UDP Send Thread init

2016-10-02 18:34:29,346 - Message Bridge - INFO - tDCR: DCR thread started

2016-10-02 18:34:29,360 - Message Bridge - INFO - UDP Listen Thread init

2016-10-02 18:34:29,366 - Message Bridge - INFO - tUDPSend: Send thread started

2016-10-02 18:34:29,374 - Message Bridge - INFO - tUDPListen: UDP listen thread started

2016-10-02 18:34:29,381 - Message Bridge - INFO - tUDPListen: listening

2016-10-02 18:34:29,446 - Message Bridge - INFO - tSerial: Setting ATLH1

2016-10-02 18:34:29,450 - Message Bridge - DEBUG - AT: Enter Command Mode

2016-10-02 18:34:30,555 - Message Bridge - DEBUG - AT: Wait for OK

2016-10-02 18:34:31,466 - Message Bridge - DEBUG - AT: Got OK

2016-10-02 18:34:31,470 - Message Bridge - DEBUG - AT: Send command: ATVR

2016-10-02 18:34:31,474 - Message Bridge - DEBUG - AT: Wait for Response

2016-10-02 18:34:31,499 - Message Bridge - DEBUG - AT: Wait for OK

2016-10-02 18:34:31,503 - Message Bridge - DEBUG - AT: Got OK

2016-10-02 18:34:31,507 - Message Bridge - DEBUG - tSerial: FW Version: 96B SORSRF

2016-10-02 18:34:31,511 - Message Bridge - DEBUG - AT: Send command: ATSN

2016-10-02 18:34:31,515 - Message Bridge - DEBUG - AT: Wait for Response

2016-10-02 18:34:31,531 - Message Bridge - DEBUG - AT: Wait for OK

2016-10-02 18:34:31,536 - Message Bridge - DEBUG - AT: Got OK

2016-10-02 18:34:31,540 - Message Bridge - INFO - tSerial: Radio Serial Number: 000001

2016-10-02 18:34:31,544 - Message Bridge - DEBUG - AT: Send command: ATLH

2016-10-02 18:34:31,549 - Message Bridge - DEBUG - AT: Wait for Response

2016-10-02 18:34:31,563 - Message Bridge - DEBUG - AT: Wait for OK

2016-10-02 18:34:31,568 - Message Bridge - DEBUG - AT: Got OK

2016-10-02 18:34:31,572 - Message Bridge - DEBUG - AT: Send command: ATID

2016-10-02 18:34:31,576 - Message Bridge - DEBUG - AT: Wait for Response

2016-10-02 18:34:31,591 - Message Bridge - DEBUG - AT: Wait for OK

2016-10-02 18:34:31,596 - Message Bridge - DEBUG - AT: Got OK

2016-10-02 18:34:31,600 - Message Bridge - DEBUG - AT: Send command: ATEE

2016-10-02 18:34:31,604 - Message Bridge - DEBUG - AT: Wait for Response

2016-10-02 18:34:31,619 - Message Bridge - DEBUG - AT: Wait for OK

2016-10-02 18:34:31,623 - Message Bridge - DEBUG - AT: Got OK

2016-10-02 18:34:31,628 - Message Bridge - DEBUG - AT: Send command: ATEK

2016-10-02 18:34:31,632 - Message Bridge - DEBUG - AT: Wait for Response

2016-10-02 18:34:31,680 - Message Bridge - DEBUG - AT: Wait for OK

2016-10-02 18:34:31,684 - Message Bridge - DEBUG - AT: Got OK

2016-10-02 18:34:31,688 - Message Bridge - DEBUG - AT: Leave Command Mode

2016-10-02 18:34:31,693 - Message Bridge - DEBUG - AT: Send command: ATDN

2016-10-02 18:34:31,697 - Message Bridge - DEBUG - AT: Wait for OK

2016-10-02 18:34:31,710 - Message Bridge - DEBUG - AT: Got OK

And then it continues like this when running ConfigurationWizard

2016-10-02 18:40:51,279 - Message Bridge - DEBUG - tUDPListen: Received JSON: {"type": "MessageBridge", "network": "ALL"} From: ('192.168.0.120', 59370)

2016-10-02 18:40:51,284 - Message Bridge - DEBUG - tUDPListen: JSON of type MessageBridge, passing to qMessageBridge

2016-10-02 18:40:51,377 - Message Bridge - DEBUG - tMain: Processing MessageBridge JSON message

2016-10-02 18:40:51,382 - Message Bridge - DEBUG - tMain: Put {'timestamp': '02 Oct 2016 18:40:51 +0000', 'state': 'Running', u'type': u'MessageBridge', u'network': 'Serial'} on qUDPSend

2016-10-02 18:40:51,410 - Message Bridge - DEBUG - tUDPSend: Got json to send: {"timestamp": "02 Oct 2016 18:40:51 +0000", "state": "Running", "type": "MessageBridge", "network": "Serial"}

2016-10-02 18:40:51,421 - Message Bridge - DEBUG - tUDPSend: Put message out via UDP

2016-10-02 18:40:57,814 - Message Bridge - DEBUG - tUDPListen: Received JSON: {"type": "MessageBridge", "network": "ALL"} From: ('192.168.0.120', 59370)

2016-10-02 18:40:57,819 - Message Bridge - DEBUG - tUDPListen: JSON of type MessageBridge, passing to qMessageBridge

2016-10-02 18:40:57,907 - Message Bridge - DEBUG - tMain: Processing MessageBridge JSON message

2016-10-02 18:40:57,912 - Message Bridge - DEBUG - tMain: Put {'timestamp': '02 Oct 2016 18:40:57 +0000', 'state': 'Running', u'type': u'MessageBridge', u'network': 'Serial'} on qUDPSend

2016-10-02 18:40:57,949 - Message Bridge - DEBUG - tUDPSend: Got json to send: {"timestamp": "02 Oct 2016 18:40:57 +0000", "state": "Running", "type": "MessageBridge", "network": "Serial"}

2016-10-02 18:40:57,954 - Message Bridge - DEBUG - tUDPSend: Put message out via UDP

2016-10-02 18:41:02,806 - Message Bridge - DEBUG - tUDPListen: Received JSON: {"type": "MessageBridge", "network": "ALL"} From: ('192.168.0.120', 59370)

2016-10-02 18:41:02,810 - Message Bridge - DEBUG - tUDPListen: JSON of type MessageBridge, passing to qMessageBridge

2016-10-02 18:41:02,927 - Message Bridge - DEBUG - tMain: Processing MessageBridge JSON message

2016-10-02 18:41:02,931 - Message Bridge - DEBUG - tMain: Put {'timestamp': '02 Oct 2016 18:41:02 +0000', 'state': 'Running', u'type': u'MessageBridge', u'network': 'Serial'} on qUDPSend

2016-10-02 18:41:02,941 - Message Bridge - DEBUG - tUDPSend: Got json to send: {"timestamp": "02 Oct 2016 18:41:02 +0000", "state": "Running", "type": "MessageBridge", "network": "Serial"}

2016-10-02 18:41:02,951 - Message Bridge - DEBUG - tUDPSend: Put message out via UDP

2016-10-02 18:41:06,648 - Message Bridge - DEBUG - tUDPListen: Received JSON: {"data": {"toQuery": [{"command": "DTY"}, {"command": "APVER"}, {"command": "CHDEVID"}], "id": "179a2417-525e-4361-bc36-b6312bbc7068", "timeout": 30}, "type": "DeviceConfigurationRequest", "network": "Serial"} From: ('192.168.0.120', 59370)

2016-10-02 18:41:06,653 - Message Bridge - DEBUG - tUDPListen: JSON of type DeviceConfigurationRequest, passing to qDCRRequest

2016-10-02 18:41:06,856 - Message Bridge - DEBUG - tDCR: Got a request to process

2016-10-02 18:41:06,861 - Message Bridge - DEBUG - tDCR: started DCR timeout with period: 30

2016-10-02 18:41:36,915 - Message Bridge - DEBUG - tDCR: DCR timeout expired

2016-10-02 18:41:36,919 - Message Bridge - WARNING - tDCR: Failed current DCR due to timeout

2016-10-02 18:41:36,926 - Message Bridge - DEBUG - tDCR: removed stale query from qSerialToQuery

2016-10-02 18:41:36,934 - Message Bridge - DEBUG - tDCR: Sent DCR reply to qUDPSend

2016-10-02 18:41:36,959 - Message Bridge - DEBUG - tUDPSend: Got json to send: {"keepAwake": 0, "type": "DeviceConfigurationRequest", "data": {"toQuery": [{"command": "DTY"}, {"command": "APVER"}, {"command": "CHDEVID"}], "state": "FAIL_TIMEOUT", "id": "179a2417-525e-4361-bc36-b6312bbc7068", "timeout": 30, "replies": {}}, "network": "Serial", "timestamp": "02 Oct 2016 18:41:36 +0000"}

2016-10-02 18:41:36,970 - Message Bridge - DEBUG - tUDPSend: Put message out via UDP

2016-10-02 18:41:49,678 - Message Bridge - DEBUG - tUDPListen: Received JSON: {"data": {"toQuery": [{"command": "DTY"}, {"command": "APVER"}, {"command": "CHDEVID"}], "id": "179a2417-525e-4361-bc36-b6312bbc7068", "timeout": 30}, "type": "DeviceConfigurationRequest", "network": "Serial"} From: ('192.168.0.120', 59370)

2016-10-02 18:41:49,686 - Message Bridge - DEBUG - tUDPListen: JSON of type DeviceConfigurationRequest, passing to qDCRRequest

2016-10-02 18:41:49,959 - Message Bridge - DEBUG - tDCR: Got a request to process

2016-10-02 18:41:49,964 - Message Bridge - DEBUG - tDCR: started DCR timeout with period: 30

2016-10-02 18:42:20,018 - Message Bridge - DEBUG - tDCR: DCR timeout expired

2016-10-02 18:42:20,022 - Message Bridge - WARNING - tDCR: Failed current DCR due to timeout

2016-10-02 18:42:20,028 - Message Bridge - DEBUG - tDCR: removed stale query from qSerialToQuery

2016-10-02 18:42:20,038 - Message Bridge - DEBUG - tDCR: Sent DCR reply to qUDPSend

2016-10-02 18:42:20,044 - Message Bridge - DEBUG - tUDPSend: Got json to send: {"keepAwake": 0, "type": "DeviceConfigurationRequest", "data": {"toQuery": [{"command": "DTY"}, {"command": "APVER"}, {"command": "CHDEVID"}], "state": "FAIL_TIMEOUT", "id": "179a2417-525e-4361-bc36-b6312bbc7068", "timeout": 30, "replies": {}}, "network": "Serial", "timestamp": "02 Oct 2016 18:42:20 +0000"}

2016-10-02 18:42:20,054 - Message Bridge - DEBUG - tUDPSend: Put message out via UDP

2016-10-02 18:42:38,399 - Message Bridge - DEBUG - tUDPListen: Received JSON: {"type": "MessageBridge", "network": "ALL"} From: ('192.168.0.120', 49564)

2016-10-02 18:42:38,413 - Message Bridge - DEBUG - tUDPListen: JSON of type MessageBridge, passing to qMessageBridge

2016-10-02 18:42:38,597 - Message Bridge - DEBUG - tMain: Processing MessageBridge JSON message

2016-10-02 18:42:38,602 - Message Bridge - DEBUG - tMain: Put {'timestamp': '02 Oct 2016 18:42:38 +0000', 'state': 'Running', u'type': u'MessageBridge', u'network': 'Serial'} on qUDPSend

2016-10-02 18:42:38,649 - Message Bridge - DEBUG - tUDPSend: Got json to send: {"timestamp": "02 Oct 2016 18:42:38 +0000", "state": "Running", "type": "MessageBridge", "network": "Serial"}

2016-10-02 18:42:38,654 - Message Bridge - DEBUG - tUDPSend: Put message out via UDP

2016-10-02 18:42:42,427 - Message Bridge - DEBUG - tUDPListen: Received JSON: {"data": {"toQuery": [{"command": "DTY"}, {"command": "APVER"}, {"command": "CHDEVID"}], "id": "3ebb9f28-319b-4494-b48b-2693a52531e3", "timeout": 30}, "type": "DeviceConfigurationRequest", "network": "Serial"} From: ('192.168.0.120', 49564)

2016-10-02 18:42:42,431 - Message Bridge - DEBUG - tUDPListen: JSON of type DeviceConfigurationRequest, passing to qDCRRequest

2016-10-02 18:42:42,592 - Message Bridge - DEBUG - tDCR: Got a request to process

2016-10-02 18:42:42,598 - Message Bridge - DEBUG - tDCR: started DCR timeout with period: 30

2016-10-02 18:43:12,654 - Message Bridge - DEBUG - tDCR: DCR timeout expired

2016-10-02 18:43:12,658 - Message Bridge - WARNING - tDCR: Failed current DCR due to timeout

2016-10-02 18:43:12,667 - Message Bridge - DEBUG - tDCR: removed stale query from qSerialToQuery

2016-10-02 18:43:12,679 - Message Bridge - DEBUG - tDCR: Sent DCR reply to qUDPSend

2016-10-02 18:43:12,691 - Message Bridge - DEBUG - tUDPSend: Got json to send: {"keepAwake": 0, "type": "DeviceConfigurationRequest", "data": {"toQuery": [{"command": "DTY"}, {"command": "APVER"}, {"command": "CHDEVID"}], "state": "FAIL_TIMEOUT", "id": "3ebb9f28-319b-4494-b48b-2693a52531e3", "timeout": 30, "replies": {}}, "network": "Serial", "timestamp": "02 Oct 2016 18:43:12 +0000"}

2016-10-02 18:43:12,698 - Message Bridge - DEBUG - tUDPSend: Put message out via UDP

2016-10-02 18:43:23,803 - Message Bridge - DEBUG - tUDPListen: Received JSON: {"data": {"toQuery": [{"command": "DTY"}, {"command": "APVER"}, {"command": "CHDEVID"}], "id": "3ebb9f28-319b-4494-b48b-2693a52531e3", "timeout": 30}, "type": "DeviceConfigurationRequest", "network": "Serial"} From: ('192.168.0.120', 49564)

2016-10-02 18:43:23,808 - Message Bridge - DEBUG - tUDPListen: JSON of type DeviceConfigurationRequest, passing to qDCRRequest

2016-10-02 18:43:24,203 - Message Bridge - DEBUG - tDCR: Got a request to process

2016-10-02 18:43:24,208 - Message Bridge - DEBUG - tDCR: started DCR timeout with period: 30

2016-10-02 18:43:54,263 - Message Bridge - DEBUG - tDCR: DCR timeout expired

2016-10-02 18:43:54,267 - Message Bridge - WARNING - tDCR: Failed current DCR due to timeout

2016-10-02 18:43:54,273 - Message Bridge - DEBUG - tDCR: removed stale query from qSerialToQuery

2016-10-02 18:43:54,282 - Message Bridge - DEBUG - tDCR: Sent DCR reply to qUDPSend

2016-10-02 18:43:54,307 - Message Bridge - DEBUG - tUDPSend: Got json to send: {"keepAwake": 0, "type": "DeviceConfigurationRequest", "data": {"toQuery": [{"command": "DTY"}, {"command": "APVER"}, {"command": "CHDEVID"}], "state": "FAIL_TIMEOUT", "id": "3ebb9f28-319b-4494-b48b-2693a52531e3", "timeout": 30, "replies": {}}, "network": "Serial", "timestamp": "02 Oct 2016 18:43:54 +0000"}

2016-10-02 18:43:54,312 - Message Bridge - DEBUG - tUDPSend: Put message out via UDP

And when running lsof /dev/ttyAMA0 from another terminal I get:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME python 19304 pi 4u CHR 204,64 0t0 12 /dev/ttyAMA0

So some kind of DeviceConfigurationRequest seems to be received but it times out. How can I fux this?

1 Answer 1

1

You should see communication with MessageBridge when you run ./MessageBridge.py -d -l DEBUG (but make sure you stop any running MessageBridge processes/services first). Do you have same serial port configured in MessageBridge.cfg (careful, the MessageBridge.py script overwrites this on exit e.g. when killed)? On a Raspberry Pi2, I have this serial section:

[Serial]
network = Serial
baudrate = 9600
port = /dev/ttyAMA0

Assuming you get confirmation of serial communication from MessageBridge, you should then be able to use ConfigurationWizard to do basic config on your sensors...

Finally, with MessageBridge running, you may want to check that it (and only it) is communicating with the serial port (e.g. lsof /dev/ttyAMA0).

If you can see MessageBridge successfully communicating with the Slice Of Radio (e.g. getting firmware version etc. successfully by sending AT commands), then you should be able to move on to using the Configuration Wizard to setup your sensors... The setup interactions, and then also the sensor output should show up in the debug log, and also in:

WirelessThings-LaunchPad/MessageBridge/CSVLogs/CSV_MessageBridge.csv.

1
  • In the settings I have [UDP] send_port = 50140 listen_port = 50141 but in the log I can see From: ('192.168.0.120', 49564) and From: ('192.168.0.120', 59370) Are these at all related? Commented Oct 3, 2016 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.