How to Debug Gateway and Node connection



  • Hi,

    I am new to mysensors and mycontroller, and have now spend several evenings on getting it all running 🙂

    Do anyone have a good guide to debug my setup, step by step, so that I can get an idea of why my setup wont work.

    My setup:
    a) I have installed mycontroller (1.0.0.Final) and have the server/interface running on my Rpi (Jessie).
    b) Have a serial gateway programed ( Arduino Uno + nRF24l01+) and attached to the Rpi.
    c) A Node (Arduino pro Mini + NRF24L01+ + DHT22) programmed

    Issue 1) I am missing some indication of how the system is performing.
    The mycontoller says it has connected to the Gateway.... but how often is this connection chekced? If I unplug the gateway, the Mycontroller still says OK connection....

    Issue 2) My Node seems to work OK, in the debug log (serial conn. to Arduino) I can see that the Node finds the gateway... but it do not get an ID from Mycontroller....

    How do I get debug log from the Serial Gateway controller.. (I know I have to enable debug in mysensors code, but how to monitor this data?)

    Thanks,
    Monics.


  • ADMIN

    @monics said in How to Debug Gateway and Node connection:

    Issue 1) I am missing some indication of how the system is performing.
    The mycontoller says it has connected to the Gateway.... but how often is this connection chekced? If I unplug the gateway, the Mycontroller still says OK connection....

    By default, MyController checks node alive status every 30 minutes once,
    0_1509553273300_476e5356-b265-4a92-8486-9238132ffccb-image.png

    Issue 2) My Node seems to work OK, in the debug log (serial conn. to Arduino) I can see that the Node finds the gateway... but it do not get an ID from Mycontroller....

    Change Resource logs level to Notice or Trace, Will report incoming and outgoing messages on Status >> Resources logs. Sometimes Gateway message might not reach your node. Check the node coverage between your node and gateway.
    0_1509553387996_e535b3fc-96fb-48b1-bb77-21dd270b5402-image.png

    How do I get debug log from the Serial Gateway controller.. (I know I have to enable debug in mysensors code, but how to monitor this data?)

    When you enable Resource logs level to Notice or Trace as mentioned above you can see it on Status >> Resources logs


  • MOD

    @monics

    Mycontroller has really great ways to troubleshoot!, if you want to look at OS level.

    If mycontroller is not running you can start the command

    sudo tail -f /dev/ttyUSB0
    

    This shows you all data that comes in from the sensor network



  • Why is it that 'sudo tail -f /dev/serial0' does not work?


  • MOD

    @skywatch

    What exactly does not work? 🙂

    I guess you see no output,

    1. ensure you are looking at the correct device file, it should be the same as is used for the gateway in the mycontroller software
    2. make sure mycontroller is not running.
    3. if all works okay, you should see similar output like below:
    root@orangepizero:~# tail -f /dev/ttyMySensorsGateway
    3;0;1;0;17;351
    3;5;1;0;26;0
    3;0;1;0;17;516
    3;5;1;0;26;0
    10;0;1;0;0;29.0
    


  • @Tag
    You are correct, I see no output on the screen (but I didn't realise that you have to turn off myc first!)... I will try again soon. 🙂

    I guess it is the problem with mysgw on arduino. When mysgw was on pi with radio attached I could tail the mysgw with the system live. That was a help in debugging over ssh. For now though I either have to stop myc or attach pc to the gw by removing connections to pi. It's never as easy as you think it would be, is it? 🙂


  • MOD

    @skywatch said in How to Debug Gateway and Node connection:

    Once you know it its always easy 😉
    It might be that the ttyUSB gets locked exclusively by mycontroller, so it might have to be released first.



  • @Tag

    I am not using USB. I am using direct arduino serial -> pi serial.

    About to try this as it's crashed again! 😞


  • MOD

    @skywatch

    Could it be the oinclusion botton from another post,
    What happens if you setup everything without any inclusion stuff?


 

7
Online

2.3k
Users

303
Topics

1.8k
Posts

Looks like your connection to MYCONTROLLER.ORG was lost, please wait while we try to reconnect.