ST=Fail unless I'm watching it



  • Okay that subject could probably use some work but hopefully I can explain things. I have a Raspberry PI 3 running PiGatewaySerial, and I have an arduino running the BinarySwitchSensor example code. When I first started the code I was getting ST=Fail about 90 percent of the time.

    alt text

    The image shows the serial monitor for the arduino on the right side of the picture and the terminal window for the Raspberry Pi on the left.

    Just to check the operation of the radios I ran the "gettingstarted" sketch in the RF24 library on both the raspberry pi and the arduino. The picture below shows that the radios are purring along like a kitten. No missed transmissions.

    alt text

    On a whim I decided to view the output of the ttyMySensorsGateway while the PiGatewaySerial process was running and suddenly it started working. What's more whacky, if I stopped watching the ttyMySensorsGateway it would start missing transmissions again. Then when I started watching it would start working.

    alt text

    I don't know nearly enough about the inner workings of the library to know where to even begin figuring out the source of this behavior. Any hints as to why it might be doing this?



  • Well the pictures don't seem to show up.

    These links should work. The pictures in order:

    https://flic.kr/p/J3dw4Z

    https://flic.kr/p/J3dvfe

    https://flic.kr/p/J3dwQZ


  • Hero Member

    @jerseyguy1996 I can hardly read the pictures. you can copy/paste the images in your posting. Screencopy - I usually use the 'snipping tool' in Windows.


  • Hero Member

    @jerseyguy1996 the 'fail' messages occur when the serial gateway does not acknowledge the send. I assume when you are 'not watching' the gateway is 'off'. Not that only you a looking in different direction. Although the last would be interesting as a sensor 😄


  • Hardware Contributor

    @jerseyguy1996 - "st=fail" means the receiving node or gateway has problems sending ack back to the sending node.

    Its probably a hardware issue (power and/or range). Try adding a capacitor (http://www.mysensors.org/build/connect_radio#connecting-a-decoupling-capacitor) to the receiving radio, change powersource, move receiver/sender closer to eachother or build a repeater.

    Also if you are in the testface and have the node and gateway close to each other it can be the issue. If I only have a couple of meters it performce worse.



  • @AWI Thanks for responding! I wonder if there is a way to confirm that if nothing is actively receiving information from the gateway that it is off. The system definitely works fine when I use cat to redirect the serial gateway traffic to stdout.

    pi@raspberrypi:~ $ sudo cat /dev/ttyUSB20
    0;0;3;0;14;Gateway startup complete.
    255;255;3;0;3;
    255;255;3;0;3;
    255;255;3;0;3;
    255;255;3;0;3;
    255;255;3;0;3;
    255;255;3;0;3;
    255;255;3;0;3;
    255;255;3;0;3;
    255;255;3;0;3;
    255;255;3;0;3;
    

    Prior to the redirect I get st=fail. Below is the serial monitor for the arduino sending.

    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok
    

    So basically it fails a bunch of times and then once I start viewing it on the terminal its good from that point on. The only screwing thing about that is that if i'm not viewing it on the terminal, every so often (roughly 10% of the time) one of the transmissions will succeed. Definitely doesn't seem to be a hardware issue as the thing works great......as long as the serial gateway is redirected to the terminal.



  • @sundberg84 said:

    @jerseyguy1996 - "st=fail" means the receiving node or gateway has problems sending ack back to the sending node.

    Its probably a hardware issue (power and/or range). Try adding a capacitor (http://www.mysensors.org/build/connect_radio#connecting-a-decoupling-capacitor) to the receiving radio, change powersource, move receiver/sender closer to eachother or build a repeater.

    Also if you are in the testface and have the node and gateway close to each other it can be the issue. If I only have a couple of meters it performce worse.

    Thanks for responding! I do have capacitors on both the sending and receiving radios...soldered directly to the pins. It doesn't seem to be hardware as even prior to adding the capacitors the radio was transmitting and receiving reliably using the "gettingstarted" sketch in the RF24 library.


  • Hardware Contributor

    @jerseyguy1996 - Do you have a controller behind the gateway? The req ID means the node is asking for a ID from the controller. It looks like the gateway recieves this request but there is no responce.



  • @sundberg84 said:

    @jerseyguy1996 - Do you have a controller behind the gateway? The req ID means the node is asking for a ID from the controller. It looks like the gateway recieves this request but there is no responce.

    That's a good question. So when I run 'make all' on the mySensors Raspberry repository:

    https://github.com/mysensors/Raspberry

    I get two executables. There is the PiGatewaySerial and PiGateway. Do they both need to be running? I may have been under the mistaken impression that you could run one or the other. I'll give it a try.


  • Hardware Contributor

    @jerseyguy1996 - You need one gateway and one controller. The gateway can be in different shapes, like ethernet or serial - i think the one you mention is different gateway. You also need a controller. The gateway is more of the communicatior between nodes and controller, where the controller is the brain and GUI.



  • @sundberg84 Dang....now I'm really confused. I was under the impression that PIGatewaySerial handled assigning node id's and such. How would I find that out? I don't see a whole lot of documentation on this repository although I'm sure it exists......it seems pretty well built. The end result of all of this is to hopefully bind this serial connection to openhab. That's the goal at least.


Log in to reply
 

Suggested Topics

13
Online

11.4k
Users

11.1k
Topics

112.7k
Posts