Ethernet Gateway problem
-
The shield maybe has a HW workaround to handle the SPI issue. I have gotten my GW to work using Ethernet as well, but have not investigated stability. My primary concern for the moment is to make sure the SPI problem is resolved in a good way. Using a soft SPI solution at least works, but I think of it is a last resort.
-
Well, the gateway worked fine for an hour and a half, and then it stopped communicating with the sensor. Once that happens, it never recovers by itself. Have to unplug it , plug it back in and reload vera and everything starts working again.
-
Yes Have a cap on the radio and even have the radio receiving its 3.3 power from AMS1117 with everything connected to a 1 amp wall wart. It does seem to be a heat/power related problem. I noted that it stays online longer if I give it time to cool down before restarting. I am going to try a different, more capable wall wart.
-
Tried new 2 amp 5v dc power supply. Same thing--after about an hour of receiving and acknowledging sensor messages, stopped responding to the messages. Plugin still appears to be connected to and communicating with Vera via the Ethernet, but no responding to (and probably not hearing) the sensor. My inclination is to blame the sharing of the SPI bus but I have no direct evidence and doubt that it is causing my problem. Need suggestions for further debugging. The only clue is that unplugging and plugging in the gateway results in it reestablishing commo with the sensor. It never appears to lose Ethernet commo with Vera.
-
sensor sends light level once per minute (if it changes during that time). Only one sense reporting
-
I now have the gateway plugged into the computer to read the serial moniter. Had the sensor hooked up before and the gateway was plugged into the vera. Per the Serial.print line in the gateway sketch it showing the messages it is sending to the sensor. Will see if it hangs up after a while when it is not plugged into the internet. Given that it seems to be executing the main loop properly, would think it is a hardware problem that causes it to eventually stop.
-
With the Ethernet gateway hooked to the pc and on the serial monitor, it just keeps humming along with no hang ups. So my gateway hangups are Ethernet related.
-
Would like to try the softSPI solution but as a newbie I am not sure how to modify the gateway sketch and associated libraries to do this. Can anyone provide specific step by step instructions on how to modify and compile the gateway with softSPI?
-
I am a bit short on time tonight, but here is at least some pointers to get this to work:
- Get the patched RF24 lib
- Download the DigitalIO library and add it to your library tree (next to MySensors lib)
- Patch RF24_config.h to enable softspi, uncomment
//#define SOFTSPI
and select pins to use with
const uint8_t SOFT_SPI_MISO_PIN = 15;
const uint8_t SOFT_SPI_MOSI_PIN = 14;
const uint8_t SOFT_SPI_SCK_PIN = 16;
The setting above mean MOSI on A0, MISO on A1 and SCK on A2 on an Arduino Nano.
I am going to give it another shot to patch the code to use the hardware SPI but I need a couple of days to do it (have other things going on at the moment). If I fail I will check with @hek if the ethernet gw description should be updated with info on how to use softSPI or how we should proceed (perhaps choosing a different ethernet module). No matter what, I intend to bend the W5100 to my will and once I got it wrestled down, I will share the details. This thread would be a good place to track that:
-
I am a bit short on time tonight, but here is at least some pointers to get this to work:
- Get the patched RF24 lib
- Download the DigitalIO library and add it to your library tree (next to MySensors lib)
- Patch RF24_config.h to enable softspi, uncomment
//#define SOFTSPI
and select pins to use with
const uint8_t SOFT_SPI_MISO_PIN = 15;
const uint8_t SOFT_SPI_MOSI_PIN = 14;
const uint8_t SOFT_SPI_SCK_PIN = 16;
The setting above mean MOSI on A0, MISO on A1 and SCK on A2 on an Arduino Nano.
I am going to give it another shot to patch the code to use the hardware SPI but I need a couple of days to do it (have other things going on at the moment). If I fail I will check with @hek if the ethernet gw description should be updated with info on how to use softSPI or how we should proceed (perhaps choosing a different ethernet module). No matter what, I intend to bend the W5100 to my will and once I got it wrestled down, I will share the details. This thread would be a good place to track that:
@Anticimex Thanks for your input. I downloaded the digitalio library. I assume that I should overwrite the Rf24 lib entries in the Mysensors Utilities lib folder with their patched counterparts?
-
@Anticimex Thanks for your input. I downloaded the digitalio library. I assume that I should overwrite the Rf24 lib entries in the Mysensors Utilities lib folder with their patched counterparts?
-
Correct. And I forgot to mention that you also need to include digitalio.h in you gateway sketch as well in order to compile.
I have had some promising progress with my software patches. I hope to bring good news by the end of the week. -
In doing research on this I came across:
https://github.com/nicoverduin/rf24
Didn't know whether you all considered his implementation, but appears to have the same objective of allowing for softSPI on the radio. -
Am getting a compile error on this line in RF24.h:
SoftSPI<SOFT_SPI_MISO_PIN, SOFT_SPI_MOSI_PIN, SOFT_SPI_SCK_PIN, SPI_MODE> spi;
error: ISO C++ forbids declaration of 'SoftSPI' with no type
error: expected ';' before '<' token -
Am getting a compile error on this line in RF24.h:
SoftSPI<SOFT_SPI_MISO_PIN, SOFT_SPI_MOSI_PIN, SOFT_SPI_SCK_PIN, SPI_MODE> spi;
error: ISO C++ forbids declaration of 'SoftSPI' with no type
error: expected ';' before '<' token -
Double checked. Yes I have.
-
Hum...then I cannot think of anything more than that I had to change (because I made that mistake and the error message looks familiar).
But if you are patient a while longer, I will push a patch to githup with a fix for the ethernet gateway sketch so it works with HW SPI. I have confirmed it now. -
Figured it out and had a successful compile. Did not have my digital IO Lib properly set up. Now to download and test on the gateway!