Serial Gateway woes



  • I'm working on an energy meter using an Arduino Nano. My prototype works well. It ships its data off to a MySensors Gateway running on a Raspberry Pi (RPi) which forwards the data to an MQTT broker. Home Assistant picks up the data from the broker. (Home Assistant is running in Virtual Box.) Virtual box is running on an x86 computer with Ubuntu OS) This works

    But if I use a MySensors Serial Gateway I can eliminate the RPi and the MQTT broker. I can put the MySensors Serial Gateway on an Arduino Nano.

    What happens, though, is that Home assistant recognizes the serial gateway, and the device is recognized but no data is accepted. When I put a serial monitor on the serial port, I see that the serial gateway is sending the data.
    Has anyone successully run this configuration: Nano<-->(Nano?) Serial Gateway<-->Virtual Box<-->Home Assistant? (Note, official Uno R3 doesn't work, either.)

    The MySensors Serial Gateway example is only modified with my pecularities: nRF24l01 CE and CS are connected to Pins 9 and 10 and the radio channel I use is 86. Also, I comment out the #define MY_DEBUG line

    Virtual Box is set up per the Home Assistant instructions In addition, a serial port must be configured (enable, Port Mode [Host Device] Path/Address [/dev/ttyUSB0]). the same thing can be done from the command line

    VBoxManage modifyvm $VM --usbehci on --usb on --uart1 0x3F8 4 --uartmode1 /dev/ttyUSB0
    

    Where $VM is the name of the virtual machine
    )
    Here's the steps,

    • I remove power from the Arduino Nana device
    • I must leave the Nano running the Gateway in the USB port becase the Virtual Machine won't start without it.
      In Home Assistant
    • Delete all MySensors devices: settings-->Devices and Services-->Devices(tab)
    • Delete the MySensors Integration: settings-->Devices and Services-->MySensors-->Integration Entries (three vertical dots)-->delete
    • Using Studio Code Server, delete the mysensors persistence file (it should be empty at this point)
    • Reboot Home Assistant. Development tools-->[RESTART]-->Restart Home Assistant (I have also tried the option is uder a
      Advanced, including powering off the computer and even re-installing Virtual Box and re-installing Home Assistant in Virtual box)
    • After Home Assistant returns, I configure the MySensors integration for a serial gateway. One quirk, the serial port is /dev/ttyS0, not ttyUSB0
    • I restart MySensors
    • I wait a minute
    • I press the reset button on the Nano running the MySensors Gateway.
    • I wait a minute
    • At this point I can (usually) see the gateway in devices, under the MySensors integration, and, using Studio Code Server, in the MySensors persistant file.
    • I power of the Nano that is the sensor device.
    • I wait a minute
    • I ensure that data is sent from the sensor device.
    • I wait a minute
    • I see the sensor device in the same places as the gateway, BUT none of those places show the data that has been sent.

    Yes, it appears to be a Home Assistant issue, but I suspect a MySensors person wrote the integration.


Log in to reply
 

Suggested Topics

  • 1
  • 2
  • 1
  • 5
  • 3
  • 3

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts