Connect Serial Gateway to Openwrt routers TX RX pins



  • It is possible to connect Serial Gateway to router's TX RX pins?

    Will be nice not using router's usb port, and leave it for someone else.
    Would like to use MySensors wit Domoticz installed on router.
    Right now WiFi Gateway used.



  • found some thing - How to terminate console on serial port (UART)
    am i on right direction?



  • Does the MySensors gateway + domoticz already run on your router? Then I would say yes, just tell mysgw that your serial gateway is /dev/ttyXXX (whatever your router serial port is).


  • Admin

    @derrij

    I think that you always get debug messages from uBoot on the router serial port. But this is only during booting.

    The kernel debug messages should be possible to disable (with the information from the link that you provided)



  • MySensors and Domoticz are the best!
    I did not think it would be so easy.
    I did not have to make changes to the router's firmware.
    All i need set speed in serial gateway

    #define MY_BAUD_RATE 115200
    

    On router make

    ln -s /dev/ttyS0 /dev/ttyUSB1
    
    


  • This post is deleted!


  • it works, but now i see it unstable. a lot of garbage received

    2;5;1;0;35;184.367
    ;0.13;1;1;013;6;1;0;16;1
    ;4;1;0;24;121056
    2;4;1;0;35;121.056```


  • @derrij

    Did you try it with a lower baud rate? 9600?



  • I tried 57600. Right now i tried on Padavan firmware on Xiaomi router 3.
    And i can't compile firmware with lower than 57600

    But I start domoticz with -verbose 0 -loglevel 0, and it working better. Need to test more.



  • @derrij

    Are you sure you need to set the rate in the code and recompile? Shouldn't it be enough to change it in config.h and domoticz? The uart of the router should be able to change the speed at runtime like other Linux devices, right?



  • I tried set rate in domoticz and by stty -F /dev/ttyS0 9600 clocal cread cs8 -cstopb -parenb
    but after a time it come back to rate what set in

    cat /proc/cmdline
    console=ttyS0,115200n8 root=/dev/mtdblock4 rootfstype=squashfs
    

    it looks like i need to recompile firmware.



  • @derrij

    The console paramter needs to be removed completely. You cannot use the uart for domoticz and as serial console at the same time.

    https://wiki.openwrt.org/doc/recipes/terminate.console.on.serial


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.