@Boots33
Thanks a lot for the quick response.
I now have my Nano running as a serial gateway and it is connected via a USB cable directly to my controller (Raspberry Pi 4 running Home Assistant / Hass.io).
I added a local motion sensor to the Nano gateway HW and pasted the mysensors MotionSensor example code to the setup(), presentation() and loop() functions as well as to the definitions in the top of the GatewaySerial example code.
I disabled the radio definitions as I currently have no radio capability in my gateway (not sure if this was necessary).
In Home Assistant / Hass.io I updated the configuration.yaml with the following text (as described on the Home Assistant integration help):
mysensors:
gateways:
- device: '/dev/ttyUSB0'
And it works
In Home Assistant Developer Tools under States I can now see my motion sensor go on and off by the flick of my hand.
I had expected a bit more bumps on the road just to get this far, but wow - I am obviously walking in the foot prints of people who have worked hard to make it easy for the rest of us.
I am sure I will hit bumps on the way when the radios have to send results to the gateway (thick concrete walls with lots of steel), but for now I will enjoy this big success.
Thanks again Boots33
@MiKa
Hi.
oki, in case i'll add some explanation.. I'll be busy for this week but you can simply use the serial gw example from MySensors for getting started, this should work. I didn't need to create a special board in arduino for this board, so if you're using it, you'll need to install&use the mattairtech SAMD21 board definition for the pin mapping.
https://github.com/mattairtech/ArduinoCore-samd
I've added all the files manually so things should be there now (though I'd recommend grabbing things from github to preserve directory structure and get all the files).
As promised, what I found so far: the following dockerfile yeilds a usable cross-compile environment, provided you use it with a Makefile.
FROM ubuntu:xenial
RUN apt-get update \
&& apt-get install --yes \
vim \
build-essential \
git
RUN git clone https://github.com/raspberrypi/tools
RUN git clone https://gist.github.com/3873805.git /build
WORKDIR "/build"
CMD ["/usr/bin/make", "CC=/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc"
, "HelloWorld"]
# Seems I need a real makefile for the above to work.
For cross compiling mysensors to work, hoever, you also need to properly seed the variable in configure, for it to work correctly. This is where I left off.
Sources:
https://stackoverflow.com/questions/18007326/how-to-change-default-values-of-variables-like-cc-in-makefile
https://bitbucket.org/mitchallen/pi-hello-cross-compile/src/master/
https://desertbot.io/blog/how-to-cross-compile-for-raspberry-pi
https://github.com/mitchallen/pi-cross-compile/blob/master/Dockerfile
https://github.com/mysensors/MySensors/blob/development/configure
https://github.com/raspberrypi/tools/tree/master/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin
https://www.raspberrypi.org/documentation/linux/kernel/building.md
https://www.mysensors.org/build/raspberry