[SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
-
Ok, thanks for the info @tbowmo . I had seen the issue documented in threads, but thought folks had worked around it here. I just haven't been able to distill the different threads into "here's the fix" :-) (assuming there is one). I believe others have this combination working, right?
Is it still true that SoftSPI won't work with the RFM69 (as I've seen on other threads)? That would get us a separate MISO line, but I had read it didn't work with that radio yet.
-
Did you edit the w5100.h according to the instructions @jpaulin posted in the thread you linked to?
The editing of w5100.h is different depending on with CS pin you use.
As I use D9 for the radio#define MY_RF69_SPI_CS 9And pin D10 for the w5100 CS and edited the w5100.h like this:
#else inline static void initSS() { DDRB |= _BV(2); }; inline static void setSS() { cli(); PORTB &= ~_BV(2); }; inline static void resetSS() { PORTB |= _BV(2); sei(); }; #endif -
@korttoma
I remember i checked, in recent Mysensors lib, w5100+rfm69 on same hardware spi bus without any changes to the w5100 lib.. Isn't it working??@scalz said in Yet another RFM69HCW / W5100 ethernet gateway thread :-):
@korttoma
I remember i checked, in recent Mysensors lib, w5100+rfm69 on same hardware spi bus without any changes to the w5100 lib.. Isn't it working??Depends on your W5100 module :)
-
tested it with this module https://www.itead.cc/w5100-ethernet-network-module.html and a 8Mhz/3.3v arduino mini if i remember (so no level shifting needed in my case)
-
My RFM69 EthGW is built on the 2.1.0 version of the MySensors library and back then the w5100 lib hack was required. I don't know what the case is with current available MySensors Lib versions. And I don't have additional hardware to test this on...
-
Hi guys,
Thanks for all the responses! I had not made any edits to the w5100.h file because a) I thought I had read they had become unnecessary, and b) I wasn't sure what exact values to use. Does the W5100 shield use pin 10 for CS? (pretty sure it uses 10 for the Ethernet module and 4 for the SD card, which I don't use, but hadn't had time to research for sure yet)... I'm using this shield, not a module, so I can't change the wiring. I've ordered the module-based W5100, but it'll be early June before I get it.
With that said, I wonder it it's an issue between mysensors and specifically the Adafruit breakout of the RFM69HCW? Just to test a different way, I quickly last night built a raspberry pi Ethernet gateway (so the W5100 isn't' involved) and I had the same problem with the radio (failed to init). The radio initializes and works fine with the tests here, so I believe the radios are good. They just don't seem to respond to either an Arduino-based gateway or the raspberry pi one. I've ordered a couple of 'bare bones" RFM69HCW radios to test with.
--Steve
-
Hey guys,
quick update: got this working, at least on the gateway side -- haven't tried hooking up a node yet, that's next... Once I confirm that works, I'll add SOLVED to the title of this. :-)
For the gateway, I went digging through the new driver code, looking for things to try and adding some debug writes, and found the code in RFM69_Initialise() where, if MY_RFM69_RST_PIN is defined, it will reset the radio. I already had the RST line on the RFM69HCW wired up, and had previously (with the old driver) manually added code to do it, but it didn't help...
But with the new driver from the dev branch (used by #define MY_RFM69_NEW_DRIVER) I just added
#define MY_RFM69_RST_PIN 6
to my sketch and now I get...
0;255;3;0;9;0 MCO:BGN:INIT GW,CP=RPNGA---,VER=2.2.0-beta 0;255;3;0;9;26 TSM:INIT 0;255;3;0;9;28 TSF:WUR:MS=0 0;255;3;0;9;36 TSM:INIT:TSP OK 0;255;3;0;9;39 TSM:INIT:GW MODE 0;255;3;0;9;43 TSM:READY:ID=0,PAR=0,DIS=0 0;255;3;0;9;46 MCO:REG:NOT NEEDED IP: 192.168.0.215 0;255;3;0;9;1350 MCO:BGN:STP 0;255;3;0;9;1353 MCO:BGN:INIT OK,TSP=1I had read somewhere that the Adafruit breakout normally pulls RST high and supposedly resets itself at power-on, but I guess that wasn't enough... Explicitly resetting the radio seems to have done the trick and may be required for the Adafruit RFM69HCW breakout.
Going to see if I can get the raspberry pi GW working now, since my curiosity is piqued :-)
Thank you all for the help and input!
--Steve
-
Hey guys,
Another update... and an admission :-).
After playing with it some more, it looks like I mis-read the details on how the Adafruit breakout treats the reset pin. I hard connected it to ground and it now works without setting the RST_PIN define. Apparently we just need to explicitly pull the RST pin low (which makes sense). Having the 'define' set was doing that in code earlier.
You do have to have the new drivers, but don't have to fool with the reset pin. The GW works in both Arduino and raspberry pi now.
thanks for thinking through this with me.
-
done! Thanks @mfalkvidd