|
Post by greginkansas on Jan 31, 2016 19:53:53 GMT
I have been stuck on this one for weeks. It just stops after 30min to 1or 2 hours with not connected. Some time it will still receive commands other times just nothing. How about a fresh set of eyes? This one has 2 RGB leds in a fiber optic base, a house mood light just for fun "are we home, temp, humidity, is roomba running, how many computers are on, is zoneminder on" I send new values every 5 minutes right now 7 nodes 2.3 master all keep right on running with openhab computourist wiil more than likely see the error in minutes Thanks Greg
|
|
|
Post by papa on Feb 1, 2016 18:31:45 GMT
Did you make the recommended change in w5100.h ? Missing that can cause interrupted connections.If not, try these instructions I copied from my Success... ThreadThe Gateway sketch, RFM_MQTT_GW_22.ino, also includes the note: "// - Interrupts are disabled during ethernet transactions in w5100.h (Ethernet library)// (See harizanov.com/2012/04/rfm12b-and-arduino-ethernet-with-wiznet5100-chip/)" That means ... --------------------------------------------------------------- Summarizing & narrowing down the harizanov.com ... info for our project's purposes: in the New release duplex gateway threadCompuTourist posted the following on Feb 19, 2015 at 10:45am Yes, replace: [Papa: find these lines in w5100.h] #else inline static void initSS() { DDRB |= _BV(2); }; inline static void setSS() { PORTB &= ~_BV(2); }; inline static void resetSS() { PORTB |= _BV(2); }; #endif with: [Papa: actually ADD what I put in bold face below] #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 ------------------------------------------------- According to my limited understanding, (in the bold faced additions above) cli() turns off interrupts briefly & sei() turns them back on. This is supposed to improve transmissions between RFM69 transceivers, preventing drop outs, & I found that true. Maybe you wonder "Where & how do I make those changes in w5100.h?" w5100.h is a library file needed for the Arduino Ethernet Shield that is part of the Gateway. w5100.h comes with the Arduino IDE in the Ethernet library & is at your path version of "C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h"Hint: In order to edit & re-save w5100, you'll probably need to shut down the Arduino IDE & possibly reboot your computer because the Arduino IDE / Gateway sketch "lock" the file. Once you find the w5100.h file, open it with a text editor (like Notepad++), make the 2 additions noted above (in bold face for visibility, not in your file) & re-save w5100.h. As noted, these changes seem to improve the reliability of the RFM69 transceivers' transmissions. PS Every time you install a new version of the Arduino IDE, you will need to make these changes to w5100.h
|
|
|
Post by computourist on Feb 2, 2016 7:55:22 GMT
Hi greginkansas , I see you are trying to use lowpowermode, SPIflash and I2C, all at the same time ! SPIflash will probably not work "as-is" because the RFM-module is also using the SPI bus. For the MQTT-gateway we had to change the library to prevent collisions in Interrupt requests. Same goes for I2C and lowpowermode. As far as I know both use interrupts and assume no other devices/services using interrupts. My guess is your node works OK, but messes up when simultaneous interrupts occur. The interrupt service being served is then interrupted. This is not handled well in the code, leaving the arduino in an undefined state. There are some ways to solve this: - write proper interrupt handling code - use separate processors for separate functions (as was done in the initial implementation of the gateway by Eric Tsai) - block interrupt requests during execution of critical code. (as I did in the gateway and RFID node) The choice is yours..
|
|
|
Post by greginkansas on Feb 2, 2016 12:16:53 GMT
thanks papa, but this is a node not the gateway computourist I tend to just forget interrupts, because I did not write them. I am still stuck with the 6811 mentality where I wrote everything. I will prune it down and see if that does it. Thanks for sharing your code. Greg
|
|
|
Post by papa on Feb 2, 2016 14:45:01 GMT
greginkansas, I meant "Did you edit w5100.h for the Gateway's use?" as computourist was referring to above with "block interrupt requests during execution of critical code. (as I did in the gateway ...)" Not doing that has resulted in erratic connections.
If you get things working (interrupt wise with SPIflash or I2C or lowpowermode), please share on this forum, so others of us can benefit from your efforts.
|
|
|
Post by greginkansas on Feb 3, 2016 0:20:22 GMT
Yes I have, the gateway has ran for months at a time. I have to say this system is the best I have ever had and I have had some kind of automation since the early 90s
Half of my nodes use I2C so that's out. I think some use SPI flash lib, I need to look at that. I just put it in to force sleep.
computourist's gateway and nodes openhab on a pi 1 echo with bridge server on pi 1 squeeze server on pi 1 Weewx server on pi 2
its fun back to this bad node Greg
|
|
|
Post by computourist on Feb 3, 2016 7:20:01 GMT
Hi greginkansas, glad to hear of a satisfied user ;-) Maybe nice to share the applications in which you use gateway and nodes. I for one would be interested to hear which I2C applications you use. Computourist
|
|
|
Post by greginkansas on Feb 4, 2016 0:57:19 GMT
I did hand build the first two, gateway with a mega256 and one with uno, sparkfun level converters. then got the bug I have been buying from www.anarduino.com/product.jsp$16 nodes Pro mini, flash, RTC USA built $4.55 TH02 Temperature & Humidity Sensor I2C $8.50 HP206C 24bit Precision Barometer/Altimeter I2C both have ok libs links on anarduino makes for a small nodes applications so far- Roomba node - IR to send out on a clean "Good WAF its under a bookcase now" Dinning room node - Temp, Hum, get light level, MQ2 for smoke alarm and controls two bookcases with led lighting. The light level goes to openhab for a kitchen sink light and the bookcase levels. Front porch - for outside shade temp and motion can change the porch light on motion. After I get the API running on zoneminder will force a event. Shop node -light, MQ2, Temp, Hum, motion, The light level goes to openhab for a insteon light If I can beat the RGB node I will move on to two window nodes. i have some linear motors to open close windows. Just commented out the libs in the RGB but it still stops 2 nodes to do stuff 1 for WAF and so on
|
|
|
Post by papa on Feb 4, 2016 1:26:07 GMT
Ummm, what's WAF ? From Google it could be Web Application Firewall (or Framework) Wife Acceptance-Approval-Appeal Factor Is it one of those or something else?
|
|
|
Post by greginkansas on Feb 4, 2016 1:40:34 GMT
Trust me WAF=Wife Acceptance-Approval hide roobma = WAF fiber optic house mood light = WAF
|
|
|
Post by papa on Feb 4, 2016 2:58:32 GMT
Big ;-), know what you mean. "If Mama ain't happy, NOBODY happy. You can play with your tech toys if it fits in, contributes to the 'nest.'"
|
|
|
Post by greginkansas on Feb 6, 2016 23:12:33 GMT
Found it finally, on the miniwireless D3 is is also SS for the memory chip. So when I was doing a analogwrite to it and it went <>2V and a msg came or went crash city. This seems to be it, the node is running good now. I was just trying to get all of the pwm I could! After a day or two I will cut the trace to the mem chip.
Thanks computourist and papa
Greg
|
|
|
Post by papa on Feb 7, 2016 1:46:00 GMT
greginkansas, I'm glad you worked it out. Good troubleshooting, one of the most important skills to have with this project.
|
|
|
Post by greginkansas on Feb 9, 2016 0:25:47 GMT
Cut the SS to the mem chip and 11 hours uptime. Silly mistake. Computourist made me look again. So I was pulling the mem chip and it must have been getting on the SPI bus.
Greg
|
|