Finally I've solved. I'm still using UIPEthernet sincee my problem was the use of DHT library (last rev) with UIPEhernet lib.
I was having a restart of teh ETH port each time I was reading Temp/hum. I've changed into SimpleDHT lib and now it's working fine. I'm using a mix of W5100 and ENC28J60.
@scurb This looks very interesting and my factor now to save me from having to create my own :-). I have been planning to do the same thing (although maybe on a smaller software scale) by writing a simple Python server that would pull serial packets off of a gateway arduino (either running mysensors or something I write myself) and pipe this through MQTT to openHAB. I have two questions:
How do you interface with a sensor network? Do you go through a serial connection to read the serial packet format (a,b,c,d)? I see several implementations that put the mqtt client directly on the Arduino, but it seems much cheaper for me to just plug it into a USB port to get a virtual serial port instead of investing in a separate ethernet shield
How does an item configurations look like for a switch in openHAB? I'm looking to build a toggle switch which toggles light on or off every time it is activated, and I cannot really understand how to configure the switch to allow this behaviour for an mqtt input.
Feel free to take the second question with me directly since this might not be very interesting to the others in the forum
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
Aah ok that makes sense. My application is for rural use and I need the max distance possible. The slow response will not be a problem as the sensors don't send a lot of data at all. So maybe I will stay with the SF4096 for now but I will do some experimenting with the settings. Just to understand them a bit better.