Hi. Is there a way to control Arduino using Mysensors, but only to connect Arduino using USB to Rpi with hass.io? Connection doesnt work for me … Not a single sketch works…
I use an MQTT gateway, but I belieive you can connect connect to HA using a serial gateway
I don’t have hassio though, so I have no idea how to access the usb port with that.
When I use in configuration.yaml"
mysensors:
gateways:
- device: ‘/dev/ttyACM0’
… and in Arduino any Mysensor code i recieve in Home Assistant something like:
"Error decoding message from gateway, bad data received: 9123065 TSF:TDI:TSL
"Not a valid message: not enough values to unpack (expected 5, got 0) "
I receive
Ok I’ve found the problem. In Mysensors, when we use USB as a gateway we need to comment all radios and add at least one button
// Enable and select radio type attached - this needs to be remved / commented
//#define MY_RADIO_NRF24
//#define MY_RADIO_NRF5_ESB
//#define MY_RADIO_RFM69
//#define MY_RADIO_RFM95
// Set LOW transmit power level as default, if you have an amplified NRF-module and
// power your radio separately with a good regulator you can turn up PA level.
//#define MY_RF24_PA_LEVEL RF24_PA_LOW
// Enable serial gateway - this needs to be included
#define MY_GATEWAY_SERIAL
// This variables needs to be fined (relay + Button) + Child_ID
#define RELAY_PIN 22 // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
#define NUMBER_OF_RELAYS 1 // Total number of attached relays
#define RELAY_ON 1 // GPIO value to write to turn on attached relay
#define RELAY_OFF 0 // GPIO value to write to turn off attached relay
#define BUTTON_PIN 3
#define CHILD_ID 1
…
I hope this will help someone not to waste 2 days of life