Good tip! thanks for sharing
Posts made by stevebus
-
RE: VS Code editor for Arduino
I use it and like it a lot (but then again, I'm admittedly biased - work for MSFT :-)).. I use VS Code for a lot of other non-mysensors and non-Arduino (i.e. python, node, etc) development, so it's nice to have that all consolidated in one dev tool.
It's far from a perfect tool, no doubt, but a good start. Mostly I'm just happy to get Intellisense!
-
RE: 💬 RFM69(H)W Arduino Mini Pro Shield
Thanks @jlaraujo... Definitely keep us up to date and i'll be happy to order and try it out.
-
RE: 💬 RFM69(H)W Arduino Mini Pro Shield
Was able to finish up the soldering, and just playing with the mocksensor sketch... works great! (not sure why my pics are sideways, they are straight on my machine )
Looking at the RSSI data, this sensor seems to be about the same signal strength as my other sensors (maybe even slightly better, probably due to the shorter and more solid connections). So it seems that the performance of the radio is pretty good.
-
RE: 💬 RFM69(H)W Arduino Mini Pro Shield
Ah! I see! (said the blind man ).
I had never really paid attention to PCB design, so didn't realize there were often "planes" for some widespread connections (like ground)... makes perfect sense.
Thx again for the quick responses. I'll be soldering up the rest of the connections tomorrow so I'll be able to give it a test.
-
RE: 💬 RFM69(H)W Arduino Mini Pro Shield
Thanks for the quick reply. No need for special build for IRQ (although that might be a good addition for a future rev to have that option). I can solder to a pad, it's just trickier as my E.E. training, skills, steadier hands, and better eyesight were 20+ years ago
For the holes, out of curiosity, I see the VCC hole connection trace on the board, but I can't see how the pins are all connected to GND (i.e. can't see any traces). Is it between the layers of the board? Or am I just going blind?
Thanks again for the contribution as this is a very nice project.
-
RE: 💬 RFM69(H)W Arduino Mini Pro Shield
Hi,
Neat project. This will really make for much cleaner projects for me.
I ordered a few to play with and I'm trying to understand the connections. I soldered the RFM69 module on, no problem, and the antenna. I'll do the capacitor next.
However, I'm trying to figure out the GND, VCC, and IRQ connections. Are the pads the only option for connection, or do the holes next to them work too (hole a lot easier to solder than pad :-)) ? I don't see any kind of etching connecting the two visible on either the top or the bottom. I assume the intent is to connect a wire to them and then run that wire "underneath" the mini to connect to GND, VSS, and D2 respectively?
Sorry if that's a stupid question, as I don't have tools to via the design files.
--Steve
-
RE: Ethernet Gateway ....i am lost
Probably a stupid question, but thought I'd chime in... Since you don't show it above, are you also #define'ing a MAC address (like below)... Is the MAC address unique on your network? I've seen very odd things happen with duplicate MACs.
// The MAC address can be anything you want but should be unique on your network. // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use. // Note that most of the Ardunio examples use "DEAD BEEF FEED" for the MAC address. #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
-
RE: [SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
Ok - apparently I don't know how to mark it as SOLVED
-
RE: [SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
Marking SOLVED - we are back in business. Thanks everyone!
-
RE: [SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
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.
-
RE: [SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
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=1
I 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
-
RE: [SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
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
-
RE: [SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
BTW - meant to also say that I have a ENC28J60 module laying on my desk if it's easier to get it working alongside the RFM69
-
RE: [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.
-
RE: [SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
ok, will do - from here? https://github.com/mysensors/MySensors (which branch, development?)
-
RE: [SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
Thanks for the response, though, and good catch. it's one of the reasons I choose the Adafruit breakout, it because it's 5V tolerant and I wanted to use my Uno, at least for now. I may switch to the W5100 module and a Mini or Nano in the future, though, but it'll be several weeks before the module gets here, and I wanted to get some practical experience w/ the RFM69
-
RE: [SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
the Adafruit breakout for RFM69HCW is... it has a built-in regulator and logic shifters.
-
[SOLVED] Yet another RFM69HCW / W5100 ethernet gateway thread :-)
Hi all,
I'm working on moving my very modest (two sensors) mysensors environment to the RFM69 radio and 2.1.1. of the libraries.
Setup:
- Arduino Uno R3
- Adafruit RFM69HCW breakout board (powered by the 5V from the Arduino)
- W5100 shield (not module) for the Arduino - so I can't move pins around on the shield for any SPI conflicts
this same combination worked fine with the NRF radio (i.e. same board, same Ethernet shield)
for pins, I have the radio connected this way:
- SCK - pin 13
- MISO - pin 12
- MOSI - pin 11
- CS - pin 5
- RST - pin 6
- G0 (which is DI00) - pin 2
additionally, just for completeness:
- pin 3 is connected to an inclusion button
- pins 7 - 9 are connected to LEDs
this is a picture of my setup:
and here is the sketch (with the intro and license stuff at the top removed for brevity):
// Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached //#define MY_RADIO_NRF24 #define MY_RADIO_RFM69 //#define MY_RFM69_FREQUENCY RF69_433MHZ // Define for frequency setting. Needed if you're radio module isn't 868Mhz (868Mhz is default in lib) #define MY_RFM69_FREQUENCY RF69_915MHZ // Define for frequency setting. Needed if you're radio module isn't 868Mhz (868Mhz is default in lib) #define MY_IS_RFM69HW // Mandatory if you radio module is the high power version (RFM69HW and RFM69HCW), Comment it if it's not the case // #define MY_RFM69_NETWORKID 100 // Default is 100 in lib. Uncomment it and set your preferred network id if needed // #define RF69_IRQ_PIN 4 // Default in lib is using D2 for common Atmel 328p (mini pro, nano, uno etc.). Uncomment it and set the pin you're using. Note for Atmel 328p, Mysensors, and regarding Arduino core implementation D2 or D3 are only available. But for advanced mcus like Atmel SAMD (Arduino Zero etc.), Esp8266 you will need to set this define for the corresponding pin used for IRQ #define MY_RF69_IRQ_NUM 2 // Temporary define (will be removed in next radio driver revision). Needed if you want to change the IRQ pin your radio is connected. So, if your radio is connected to D3/INT1, value is 1 (INT1). For others mcu like Atmel SAMD, Esp8266, value is simply the same as your RF69_IRQ_PIN // #define RF69_SPI_CS 15 // If using a different CS pin for the SPI bus #define MY_RF69_SPI_CS 5 // If using a different CS pin for the SPI bus // Enable gateway ethernet module type #define MY_GATEWAY_W5100 // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal) //#define MY_W5100_SPI_EN 4 // Enable Soft SPI for NRF radio (note different radio wiring is required) // The W5100 ethernet module seems to have a hard time co-operate with // radio on the same spi bus. #if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD) //#define MY_SOFTSPI //#define MY_SOFT_SPI_SCK_PIN 14 //#define MY_SOFT_SPI_MISO_PIN 16 //#define MY_SOFT_SPI_MOSI_PIN 15 #endif // When W5100 is connected we have to move CE/CSN pins for NRF radio //#ifndef MY_RF24_CE_PIN //#define MY_RF24_CE_PIN 5 //#endif //#ifndef MY_RF24_CS_PIN //#define MY_RF24_CS_PIN 6 //#endif // Enable to UDP //#define MY_USE_UDP #define MY_IP_ADDRESS 192,168,0,215 // If this is disabled, DHCP is used to retrieve address // Renewal period if using DHCP //#define MY_IP_RENEWAL_INTERVAL 60000 // The port to keep open on node server mode / or port to contact in client mode #define MY_PORT 5003 // Controller ip address. Enables client mode (default is "server" mode). // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere. //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254 // The MAC address can be anything you want but should be unique on your network. // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use. // Note that most of the Ardunio examples use "DEAD BEEF FEED" for the MAC address. #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED // Enable inclusion mode #define MY_INCLUSION_MODE_FEATURE // Enable Inclusion mode button on gateway #define MY_INCLUSION_BUTTON_FEATURE // Set inclusion mode duration (in seconds) #define MY_INCLUSION_MODE_DURATION 60 // Digital pin used for inclusion mode button #define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set blinking period #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Flash leds on rx/tx/err // Uncomment to override default HW configurations #define MY_DEFAULT_ERR_LED_PIN 7 // Error led pin #define MY_DEFAULT_RX_LED_PIN 8 // Receive led pin #define MY_DEFAULT_TX_LED_PIN 9 // Transmit led pin #if defined(MY_USE_UDP) #include <EthernetUdp.h> #endif #include <Ethernet.h> #include <MySensors.h> void setup() { } void loop() { }
other than adding a few debug prints, I haven't touched any of the library code. I 'upgraded' to the released 2.1.1 library via the Arduino IDE UI
This is what I get when I run the sketch. The 'plain' looking (i.e. non-mysensors') output is just debug statements I added to MyTransportRFM69.cpp and RFM69.cpp. I had seen on another thread that it might help to add code to pulse (low then high) the reset line at the top of the transportinit() function, which I'm doing (pin 6). Didn't help.
0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.1.1 0;255;3;0;9;TSM:INIT 0;255;3;0;9;TSF:WUR:MS=0 pulsing reset pulsing reset done slave select pin: 5 Waiting for ready mode wait for ready mode timed out radio init failed 0;255;3;0;9;!TSM:INIT:TSP FAIL 0;255;3;0;9;TSM:FAIL:CNT=1 0;255;3;0;9;TSM:FAIL:PDT 0;255;3;0;9;TSM:FAIL:RE-INIT 0;255;3;0;9;TSM:INIT pulsing reset pulsing reset done slave select pin: 5
from my debug code, it appears to be failing here in radio.initialize() in RFM69.cpp
while (((readReg(REG_IRQFLAGS1) & RF_IRQFLAGS1_MODEREADY) == 0x00) && millis()-start < timeout) { yield(); } // wait for ModeReady if (millis()-start >= timeout) { Serial.println("wait for ready mode timed out"); return false;
I have two radios (the other connected to a Nano)... I ran the Radiohead test RX sketch on the Nano, and ran the test TX sketch on this exact Uno setup (after updating the pins in the sketch to match my setup) and it worked fine, so I know the radios are good.
I read this thread as a possible recommended fix, but it kind of goes back and forth between what was done, and undone, so I'm not sure what the resulting working configuration is
Any thoughts? Next steps for troubleshooting?
-
RE: Low power Distance Sensor - Hardware issues
Very nice project and thanks for sharing. I have a deer feeder in a corner of my yard, and it's always getting empty without me knowing. I'm planning on this exact same type of project to measure the level of corn in the feeder. Would love to see your final schematic and parts list (as it changed across the thread), but no worry if you don't have it as I'm sure I can figure it out.
Thanks again for sharing.
-
RE: Reasonable radio range for a battery powered SenseBender + radio setup?
BTW - meant to mention.. The batteries I'm using measure 3.13V on my multimeter
-
Reasonable radio range for a battery powered SenseBender + radio setup?
Hi all,
What would be a reasonable 'open air' range for a SenseBender Micro board plus associated radio? I've never had good luck with regular Arduino Mini based battery powered devices, but bought the SenseBender and have fallen in love!
I'm getting great battery life now (been running nearly non-stop for a week with NO change in battery voltage), but the radio range is definitely less than a powered sensor. Running on two normal AA batteries. My gateway is out in my poolhouse, and I've been playing with the SB board from my living room, which is about 70-80 feet away. The gateway has the antennae version of the radio and has no problems picking up a powered nano-based sensor in my garage about 120ft away.
The signal from my living room is line of sight, about 70-80 ft, through two glass windows (single pane). Is this a reasonable range for a battery powered setup like mine? Powering the sensor over USB (3V FTDI friend) is no problem. Should I see that much drop-off from battery powering?
One of my ultimate goals is to instrument one of my deer feeders (to know when it's out of corn) via a battery-powered SB Micro based board. it'll be about 80-100 ft from the powered garage sensor, which runs as a repeater. Is that reasonable range for this setup?
thanks,
--Steve -
RE: Vera - Can't create GW device with UI7 files
Hey @kylehull .. thanks for the response. I've heard that before, about the need to have a genuine FTDI chipset. I had previously dug out the magnifying class and i'm pretty sure my Nano (that didn't work) says "FTDI" on the serial chipset. (not sure if there is another way to tell)... but based on the symptoms, I guess maybe it didn't..
either way, since the 2.0 libraries game out, I rebuilt my Ethernet GW and it has been rock solid. So I'm not going to rock the boat there :-).
thanks for following up on this old thread, though. I'm sure it'll help others.
-
RE: Distance for sensor and board
I'm working on a controller for keeping one of my fountains automatically full of water. The water level sensor will be about 30 feet (around 9 meters) from my Arduino board. I'm using one of the pairs from a cat-6e cable, buried under mulch, to connect the sensor. Now, in this case, it's a little easier since the sensor is just resistive, rather than having to read voltage, so I can just add in the resistance of the wire. But it seems to work fine. It's just a simple voltage divider circuit.
-
RE: Missing "node" device for mysensors on VeraEdge (UI7)
@hek Thanks - I'll try that too... if I can ever get done writing code for work so I can write code for home
-
RE: Missing "node" device for mysensors on VeraEdge (UI7)
thanks for the response.
I did not reuse the node id.
I did try deleting and re-including several times (set inclusion mode and restart node), and also tried to restart the luup engine (settings->restart z-wave, right?) before trying it, but I did not try to restart all of Vera. I'll try that.
-
Missing "node" device for mysensors on VeraEdge (UI7)
Hi all,
Not sure exactly how to phrase this question, so bare with me :-).
I have two mysensors nodes. The first one, which I've had for a while is simply a temperature sensor in the top of my garage. The second one, which is under development, is a device to keep my fountain full. It has two 'sensors', one is a water level sensor (expressed in percentage, faked with a S_LIGHT_LEVEL) and the other a switch to indicate (and control) the state of an electronic water valve for filling the pool.
The problem I'm having is this... In both the garage temp sensor, and the first time I deployed the fountain sensor, in addition to creating a device in Vera to represent the "presented' sensors, it also included a device representing the 'node' itself (circled in the screenshot)....
When I first started development of my fountain node and "included" it to Vera, it created devices to represent the two sensors and also created the device representing the node, as I wanted. However (long story), I had to move the solution to a different arduino nano and needed to delete and re-include the new device in Vera. I did that, and it created the two sensor nodes (see below), but did NOT recreate the device that represents the "node". I like having that, primarily because it gives you an indication of that last time that node updated with Vera.
Any idea why I can't get Vera to re-create all three 'devices'? it's like something is cached, but I don't know how that could be? Any ideas?
Hopefully this rambling made sense
-
My compliments to the team!
Hi all,
I've just returned to doing some mysensors work after a long absence. I'm just now trying the 2.0 release of the library (from 1.4 and 1.5 previously) and, since I know dev work can be underappreciated sometimes, I just wanted to pay my compliments to all those who contributed to the 2.0 release!
I just rev'ed my Ethernet gateway and several sensors to 2.0. VERY clean, very quick, and very cool.
If it's not said often enough, very well done guys.
(BTW - since I'm just getting started back again in earnest, I'm sure you'll next see me post some issues and questions/complaints :-), but I wanted to open with appreciation first!).
--Steve
-
RE: [SOLVED] Trash in serial monitor when battery powering... (trying to troubleshoot a hang)
Thanks all,
@LastSamurai - good catch on bonding the grounds. totally missed that. brain fart on my part. Getting good data in serial mon now.
@martinhjelmare and @mfalkvidd - thanks. I thought it was something like that. While the hang described in the original thread occurs regardless of power source (even powered from PC) and appears to be a separate issue, I did see some different erratic behavior earlier and the batteries measured at 2.91V. So probably getting close to threshold or something. And maybe it gets drug down when the radio transmits or the DHT11 reads or something, resulting in erratic behavior.
-
RE: [SOLVED] Trash in serial monitor when battery powering... (trying to troubleshoot a hang)
good question, @LastSamurai .. I don't think I did. will check that when I get back to my machine.
-
RE: [SOLVED] Trash in serial monitor when battery powering... (trying to troubleshoot a hang)
thanks for the reply... there are stories including the web site (http://www.mysensors.org/build/battery) of folks powering mysensors with Minis from two AAs, which will never reach 3.3V, so there has to be some tolerance below that in which everything still works (and even my sensor works, it just hangs after 12 hours or so).
So 3.3V can't be the minimum. Must be something lower.
-
[SOLVED] Trash in serial monitor when battery powering... (trying to troubleshoot a hang)
Hi all,
I'm still trying to solve the hangs that I described in http://forum.mysensors.org/topic/2841/mysensor-hang-on-gw-send-and-possibly-roasting-radios
however, I have a separate question. I'm trying to hook the Mini up to the serial monitor, while still powered by battery. so have I my FTDI USB cable plugged into the computer, and then just the Tx/Rx lines connected to the Tx/Rx lines on the mini. Then, separately, I hook my batteries (two AA's) to the GND and VCC pins on the Mini. I get gobblegook in the serial monitor. I know the settings are right (board type, baud rate, etc), because if I pull the battery, and run wires from the GND and VCC plugs on the FTDI cable (to GND and RAW), and don't change anything else, I get good data in the serial mon.
I have cut the power LED as outlined on the "battery powering" page, but haven't disconnected the regulator yet.
This is all with fresh batteries (3.19 V across them).
So my questions:
- if battery powering, is the VCC pin the right place to connect the positive battery lead?
- any reason why I get the trash on the serial line vs. real data when powered via the VCC pin by battery vs. 5V into the raw pin?
- what is the lowest voltage the batteries can get to and this thing still work? (unrelated to this issue, but curious).
Thanks,
--Steve
-
RE: Are we initializing the nRF24L01+ correctly?
thanks @tekka... I fear you are right. The main thing that sucks is I don't know what killed them. Oh well. Such is life.
-
RE: Arduino & Microsoft Competition
Ha! yeah - actually there are more than one of us (MSFT employees) here.
I'm not eligible for the competition (never am) because I'm an employee, but definitely encourage the community here to put the best ideas forward. There are some incredibly smart folks here and really cool projects.
-
RE: Are we initializing the nRF24L01+ correctly?
@tekka -- I downloaded the updated libraries and tried them. Still failed to initialize my "dead" radio..
from serial monitor:
Starting sensor (RNNNA-, 2.0.0-beta)
Radio init failed. Check wiring.using MockSensor to test. Wiring is correct. It's certainly possible that the radio is truly 'dead', but I don't think so, as it was working fine before resets of the Arduino (and I have another in the same state.. and the same Arduino is currently being used in a sensor with a third radio).
thoughts? I know you said it was a WIP, so it could be that it's not supposed to work yet. LMK.
-
RE: Arduino & Microsoft Competition
Good find. I bet based on some of the projects I've seen discussed here, this community could submit some really cool stuff!!
disclosure #1 - I work for Microsoft (as an IoT specialist)
disclosure #2 - I don't have anything to do with this contest (but I wish I did)... -
RE: Are we initializing the nRF24L01+ correctly?
Cool @tekka , I'll give it a try. Thanks for putting all the effort into it!
-
RE: Vera Edge and Mysensors Ethernet gateway - "Cannot send command"
I had problem with my Ethernet gateway for a long time being unstable (chronicled here -> http://forum.mysensors.org/topic/1779/ethernet-gateway-unreliable-sort-of)... the radio communication with sensors would work fine, but the Ethernet stack would lock up periodically and lose communication to Vera, as well as ping, telnet, etc.
I don't have the exact same setup you do (most specifically, I have a different Ethernet shield), but a couple of changes have really stabilized my gateway. I can still crash it, at will (mostly when trying to include new sensors), but If I leave it the hell along and don't mess with it, it will run for weeks or months without issue.
The link below was a big part of stabilizing it, but may not be relevant to you with a different Ethernet shield, but the other thing that made a big difference for me was making sure I power my radio separate from the Ethernet shield. It seems that both could not be powered through the Arduino and remain stable. I don't know if the Arduino can't source enough current to support both when the radio is transmitting, or what, but someone else suggested powering the radio separately. So, I have a the shield powered (obviously) through the Arduino, but I power the radio separately outside the Arduino. That didn't fix everything, but it got a LOT more stable after that.
Anyway - may or may not help you, but it did me.
--Steve
my network issue that may or may not apply to you.....
http://forum.mysensors.org/topic/536/problems-with-enc28j60-losing-connection-freezing-using-uipethernet-or-ethershield-read-this/41 -
RE: Are we initializing the nRF24L01+ correctly?
Have you guys been able to investigate a fix for this further? If you are looking for a Guinea Pig, I currently have two separate radios in this state. they both worked perfectly and then, sometime after a few hardware resets of the attached Arduino mini pro, they just stopped initializing ('radio init failed'). Would love to recover them if possible.
-
RE: Mysensor hang on gw.send.... (and possibly roasting radios)
@BartE - thanks for the tips. are you suggesting these may fix my hanging issue? or just generally good mysensors coding practices and can't hurt?
@mfalkvidd - Certainly could be my problem. Pulling power doesn't reset the radio, but I've only tried that after the radio won't re-initialize with the reset. So maybe I should always restart by power cycling? Any way to 'recover' the bad radios, they don't work even after a power cycle. Has anyone added the code to properly re-initialize the radio yet?
-
Mysensor hang on gw.send.... (and possibly roasting radios)
Hi all,
Mylibrary version: 1.5
Arduino Pro Mini (power LED cut to save battery)
DHT11 temperature sensor
3.3V FTDI USB cableI'm trying to build a battery powered temperatures sensor for my wife's green house. I have the device wake up every 15 minutes (will eventually do longer sleep times).
However, I'm having trouble with the code 'locking up' (I'm assuming it's hitting one of the "while(1)" loops in the mysensor code). It seems to happen after somewhere between 12 and 14 hours of running fine. I've pasted the code below, as well as a debug trace. It seems to be locking up somewhere in the gw.send(tempF, 0) call, as it's sending the updated temperature. This has happened in the same place several times. Some of the transmits fail, but that may be due to the fact that my 'dev' laptop has been probably on the outer edge of the range for the radio. But the same behavior happens even well within range. It also doesn't matter if I have it battery powered (two AAs) or powered from my laptop and FTDI cable.
When it hangs, the onboard "pin 13" LED remains lit (so presumably the SCK connected to pin 13) is held high at that point).
What is the best method folks have for debugging/troubleshooting these hangs? Do you just go into the mysensor code and riddle it with Serial.prints? I can do that, just want to minimize the dev churn as it takes it between 12 and 24 hours to fail ). Any other tips for troubleshooting this?
it may be related, but maybe not. I also seem to have killed two radios while trying to figure this out. Some times, after a certain number of hitting the 'reset' button the mini, I start getting "radio init failed" messages. Swapping out for a new radio brings it back. This has happened twice. However, it does NOT correspond to the hang-ups (i.e. I can 'reset' after a hang up and have it work again fine for a while). So maybe related, maybe not. Everything is wired on a breadboard right now. I power the radio and DHT11 from the VCC pin of the Mini.
Also, for the loop in the code below -- to try to improve a little of the accuracy of the DHT11, I read 10 values and calculate the average before sending the temps (eventually I'll be replacing the DHT with something more accurate). Just testing at this point.
Anyway - the code
#include <MySensor.h> #include <SPI.h> #include "DHT.h" //#define DEBUG DHT dht; #define NUMSAMPLES 10 int fTotal = 0.0; int iCount = 0; float humidity = 0.0; float temperature = 0.0; float averageTemp = 0.0; int BATTERY_SENSE_PIN = A0; int oldBatteryPcnt = 0; // 15 minutes #define SLEEP_TIME 900000 // in milliseconds MySensor gw; // Initialize temperature message MyMessage msg(0,V_TEMP); void setup() { // use the 1.1 V internal reference #if defined(__AVR_ATmega2560__) analogReference(INTERNAL1V1); #else analogReference(INTERNAL); #endif gw.begin(); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Temperature Sensor/DHT/Battery", "1.0"); gw.present(0, S_TEMP); // Serial.begin(9600); #ifdef DEBUG Serial.println(); Serial.println("Status\tHumidity (%)\tTemperature (C)\t(F)"); #endif dht.setup(2); // data pin 2 } void loop() { // put your main code here, to run repeatedly: // Process incoming messages (like config from server) gw.process(); bool isMetric = gw.getConfig().isMetric; // bool isMetric = false; #ifdef DEBUG Serial.println("ismetric = " + String(isMetric)); #endif for(iCount = 0; iCount < NUMSAMPLES; iCount++) { delay(dht.getMinimumSamplingPeriod()); humidity = dht.getHumidity(); temperature = dht.getTemperature(); #ifdef DEBUG Serial.print(dht.getStatusString()); Serial.print("\t"); Serial.print(humidity, 1); Serial.print("\t\t"); Serial.print(temperature, 1); Serial.print("\t\t"); Serial.println(dht.toFahrenheit(temperature), 1); #endif fTotal += temperature; } averageTemp = fTotal / (NUMSAMPLES * 1.0); #ifdef DEBUG Serial.print("average tempC: "); Serial.println(averageTemp); #endif fTotal = 0.0; if(isMetric) { #ifdef DEBUG Serial.println("Sending C data..." + String(averageTemp)); #endif gw.send(msg.set(averageTemp, 0)); } else { float tempF = (averageTemp * 1.8) + 32.0; #ifdef DEBUG Serial.println("Sending F data..." + String(tempF)); #endif gw.send(msg.set(tempF, 0)); } // get the battery Voltage int sensorValue = analogRead(BATTERY_SENSE_PIN); #ifdef DEBUG Serial.println(sensorValue); #endif // 1M, 470K divider across battery and using internal ADC ref of 1.1V // Sense point is bypassed with 0.1 uF cap to reduce noise at that point // ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts // 3.44/1023 = Volts per bit = 0.003363075 float batteryV = sensorValue * 0.003363075; int batteryPcnt = sensorValue / 10; #ifdef DEBUG Serial.print("Battery Voltage: "); Serial.print(batteryV); Serial.println(" V"); Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %"); #endif if (oldBatteryPcnt != batteryPcnt) { #ifdef DEBUG Serial.println("Sending updated battery level"); #endif gw.sendBatteryLevel(batteryPcnt); oldBatteryPcnt = batteryPcnt; } #ifdef DEBUG Serial.println("nighty night..."); #endif gw.sleep(SLEEP_TIME); #ifdef DEBUG Serial.println("Good morning!"); #endif }
and the debug lines...
send: 3-3-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
send: 3-3-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
read: 0-0-3 s=255,c=3,t=6,pt=0,l=1,sg=0:I
sensor started, id=3, parent=0, distance=1
send: 3-3-0-0 s=255,c=3,t=11,pt=0,l=25,sg=0,st=ok:Temperature Sensor/DHT/Ba
send: 3-3-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
send: 3-3-0-0 s=0,c=0,t=6,pt=0,l=0,sg=0,st=ok:Status Humidity (%) Temperature (C) (F)
gw config= 0
OK 34.0 23.0 73.4
OK 33.0 23.0 73.4
OK 33.0 23.0 73.4
OK 33.0 23.0 73.4
OK 32.0 23.0 73.4
OK 33.0 23.0 73.4
OK 33.0 23.0 73.4
OK 33.0 23.0 73.4
OK 33.0 23.0 73.4
OK 32.0 23.0 73.4
average tempC: 23.00
Sending F data...73.40
send: 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=fail:73
1023
Battery Voltage: 3.44 V
Battery percent: 102 %
Sending updated battery level
send: 3-3-0-0 s=255,c=3,t=0,pt=1,l=1,sg=0,st=ok:102
night night...
Good morning!
gw config= 0
OK 33.0 23.0 73.4
TIMEOUT nan nan nan
OK 33.0 22.0 71.6
OK 33.0 22.0 71.6
OK 33.0 22.0 71.6
OK 33.0 22.0 71.6
OK 33.0 22.0 71.6
OK 34.0 22.0 71.6
OK 34.0 22.0 71.6
OK 33.0 22.0 71.6
average tempC: 17.60
Sending F data...63.68
send: 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:64
1023
Battery Voltage: 3.44 V
Battery percent: 102 %
night night...
Good morning!
gw config= 0
OK 33.0 22.0 71.6
OK 32.0 21.0 69.8
OK 34.0 22.0 71.6
OK 32.0 22.0 71.6
OK 32.0 21.0 69.8
OK 31.0 22.0 71.6
OK 33.0 22.0 71.6
OK 33.0 22.0 71.6
OK 33.0 22.0 71.6
OK 33.0 22.0 71.6
average tempC: 21.80
Sending F data...71.24
send: 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:71
1023
Battery Voltage: 3.44 V
Battery percent: 102 %
night night...
Good morning!
gw config= 0
OK 33.0 21.0 69.8
OK 34.0 21.0 69.8
OK 33.0 21.0 69.8
OK 33.0 21.0 69.8
OK 33.0 21.0 69.8
OK 33.0 21.0 69.8
OK 33.0 21.0 69.8
OK 33.0 21.0 69.8
OK 33.0 21.0 69.8
OK 33.0 21.0 69.8
average tempC: 21.00
Sending F data...69.80
send: 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:70
1023
Battery Voltage: 3.44 V
Battery percent: 102 %
night night...
Good morning!
gw config= 0
OK 33.0 21.0 69.8
OK 29.0 17.0 62.6
OK 31.0 18.0 64.4
OK 31.0 17.0 62.6
OK 32.0 17.0 62.6
OK 30.0 17.0 62.6
OK 30.0 17.0 62.6
OK 32.0 17.0 62.6
OK 40.0 20.0 68.0
OK 31.0 17.0 62.6
average tempC: 17.80
Sending F data...64.04
send: 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:64
1023
Battery Voltage: 3.44 V
Battery percent: 102 %
night night...
Good morning!
gw config= 0
OK 30.0 17.0 62.6
OK 35.0 17.0 62.6
OK 35.0 17.0 62.6
OK 35.0 17.0 62.6
OK 35.0 17.0 62.6
OK 35.0 17.0 62.6
OK 35.0 17.0 62.6
OK 35.0 17.0 62.6
OK 35.0 17.0 62.6
OK 35.0 17.0 62.6
average tempC: 17.00
Sending F data...62.60
send: 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:63
1023
Battery Voltage: 3.44 V
Battery percent: 102 %
night night...<< some of the rounds cut out for brevity.........>>
Good morning!
gw config= 0
OK 22.0 22.0 71.6
OK 23.0 22.0 71.6
OK 23.0 22.0 71.6
OK 22.0 22.0 71.6
OK 22.0 22.0 71.6
OK 22.0 22.0 71.6
OK 22.0 22.0 71.6
OK 22.0 22.0 71.6
OK 22.0 22.0 71.6
OK 22.0 22.0 71.6
average tempC: 22.00
Sending F data...71.60
send: 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:72
1023
Battery Voltage: 3.44 V
Battery percent: 102 %
night night...
Good morning!
gw config= 0
OK 22.0 22.0 71.6
OK 23.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 25.0 21.0 69.8
OK 22.0 21.0 69.8
OK 25.0 21.0 69.8
average tempC: 21.10
Sending F data...69.98
send: 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=fail:70
1023
Battery Voltage: 3.44 V
Battery percent: 102 %
night night...
Good morning!
gw config= 0
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 21.0 69.8
OK 22.0 22.0 71.6
OK 22.0 22.0 71.6
average tempC: 21.20
Sending F data...70.16
you can see that it dies when trying to send the temperature data.
Any thoughts?
--Steve -
RE: Vera - Can't create GW device with UI7 files
Never got it working, but quit trying because of Ethernet GW has been fairly reliable lately. I've tried two different Nano's (bought from the links on mysensors site. But I assume they are clones. I'm not sure how to verify one is genuine, do you?
I'd love to get it working as an option.
-
RE: Vera Edge
Thanks Hek - the ESP8266 gateway was already on the list to investigate... so much cool stuff to do, so little time
-
RE: Vera Edge
thanks guys - good discussion.
@hek - is there a reliable way to tell if the FTDI chip is genuine? I believe I bought it from the link on the mysensors site, but it's possible I didn't. Are those known to be genuine? if so, maybe I'll rebuy and retry. I'd rather have a serial GW if I can get it working.
@Dave-Dan - it seems that a long of the Vera Edge devices (mine included) come with the USB port disabled (because apparently MCV has had trouble making them work). It's a big topic on the MCV forums. I had to engage Vera support to even get my port enabled the first time I tried a serial GW. (it's disabled again right now, after the latest FW update... sigh...)
-
RE: Vera Edge
Thanks @clio75 - that's good to hear. Are you using the Serial GW sketch pretty much unchanged and the UI7 branch of the files? I assume you had to open a ticket with Vera to get the USB port enabled on the Edge? I did that, and was in the process of trying to get the serial GW working, when a Vera update turned right around and disabled my USB port again...
-
RE: Vera Edge
@Dave-Dan - I actually haven't finished the Azure integration yet :-). I was working on it, but had some distracting other stuff come up. Essentially the short version of how I plan to do it is to is write an app, probably a Windows Universal app to run on a Raspberry PI that leverages the Vera APIs as described here -> http://wiki.micasaverde.com/index.php/UI_Simple. The app will basically do a long poll waiting on events to happen on Vera, capture them, convert them to a canonical JSON format, and post them to Azure IoTHub. From there, I'll probably leverage Azure Steam Analytics for real time alerting, data aggregation, etc, but also to push the data to a PowerBI dashboard. That's my plan, anyway :-). Just gotta find time to write it. I've started the code that calls the APIs, but just haven't finished...
@csa02221862 - I've asked a few times and have yet to find anyone who has a serial gateway working on the Vera Edge with UI7 specifically (other Vera devices, and UI versions, yes, but not the Edge/UI7 combination). I gave up, even after working with Vera support to make it work, and use an Ethernet gateway. Doesn't mean it can't be done, just wasn't worth the investment after I finally got my Ethernet gateway to be pseudo-stable.
-
RE: Vera Edge
I'm using Vera Edge. Have never gotten a serial gateway to work (all kinds of USB port issues)....
I've had an Ethernet gateway working fairly well. The gateway locks up every once in a while (every few weeks), but seems to be an GW issue and not really related to the Vera. When it works, it works pretty well.
It did take me a while to get it to this stability point, with lots of troubleshooting with the right vera files, etc, so feel free to ping me for learnings
-
RE: EthernetGateway - Radio init fail
My Uno with the enc28j60 shield is more stable, but still not THAT stable. Will go a week, sometimes two without crashing. Now it just locks up for no apparent reason. Haven't had a chance to troubleshoot it. interestingly, it always locks up now at a time when the 'receive' (green) LED is lit, so something about receiving a message over the radio is locking it up...
I tried using the wiznet shield, but so far I've gotten two bad ones (even the built-in Arduino samples don't work), so I don't put much stock in them any more.
I have been planning to swap out my enc28j60 shield for just the little detached module and see if that helps. Just amazes me as much as folks have banged on this stuff for all this time, that it's still unstable, but I guess each one is different, knock-offs, etc.
-
RE: EthernetGateway - Radio init fail
+1 on the separate power for the radio... I had all kinds of radio failures until I powered it separate from the UNO+ENC shield. Once I did, zero failures ever on the radio.
also, I had a lot of trouble getting my Ethernet GW stabilized. it would run for maybe a day and then quit responding to pings or any network traffic. I found this thread -> (http://forum.mysensors.org/topic/536/problems-with-enc28j60-losing-connection-freezing-using-uipethernet-or-ethershield-read-this) and used the alternate implementation of UIPEthernet in it and my GW just crashed yesterday for the first time in two months! (although, I can crash it, at will, by telnetting into it and typing "junk".. so I don't do that )
@hek - I didn't know there was a ENC specific GW branch. that's great! Is it stable enough to try? does it have the improvements in the thread above to the UIPEthernet library?
-
RE: Vera - Can't create GW device with UI7 files
@Nbaars - I'm not sure how you tell? it was advertised as an Arduino Nano, not a copy or clone or "compatible", but I don't know if you can rely on that. Is there an easy way to tell?
@Anticimex - interesting idea. I might explore it, but I'm pretty satisfied with my straight Ethernet GW now (except for it being a pain to debug)
-
RE: Vera - Can't create GW device with UI7 files
Yeah, I never did get it working, nor find anyone who would tell me they had the same scenario working (vera edge, UI7, serial gateway). I had to work with Vera support to get my USB port enabled at all. Once it was enabled, I tried to get the serial GW working and never did. After over a month corresponding with Vera support (they would go days without responding), they punted and said as far as they were concerned, the serial port was working and I'd need to "talk to the mysensors folks" to get it all working. So I was stuck in a loop.
However, around that same time I found an old thread that gave me a tip to get my Ethernet gateway stabilized with an alternate implementation off UIPEthernet library. I can still crash the Ethernet gateway, at will, by telneting into port 5003 and manually sending commands to it for debugging, but since I know that crashes it, I don't do it anymore :-). But if I don't fool with it, it's been working for weeks with zero issues.
Also, after a combination of deleting and re-uploading files and most importantly CLEAR YOUR BROWSER CACHE AFTER YOU DO (my one and only tip for you), I've got the UI7 Vera files working too.
So, unfortunately I don't have the answer for you (other than make sure you clear your browser cache after uploading the UI7 files) because I got my Ethernet GW stable and abandoned the serial GW.
-
RE: gw.sleep and debounce?
thanks @TheoL... Makes sense. In this case, I was wiring up a physical pushbutton for it. I can make a electronic debouncer if I need it, but in my limited testing of this, it didn't seem to need it, so I think I'm good for now. thank you for the reply!
-
gw.sleep and debounce?
Hi all,
Forgive me if this is a FAQ... A forum search came up empty
Typically, with pre-mysensors sketches, I would use the debounce library to debounce button presses that cause interrupts. Is that still necessary with gw.sleep? or does it internally debounce the button press when the interrupt is generated before it returns to the caller?
--Steve
-
RE: Problems with ENC28J60 losing connection/freezing (using UIPEthernet or etherShield)? READ THIS!
So glad to have found this thread! Sounds like the exact problem I've been having. Ethernet gateway, with enc28j60 shield would randomly stop responding to Vera, to telnet (on 5003) and to pings. Sometimes in hours, occasionally making it a few days. Looking at my sensors, the radio stack is still working fine, the Ethernet side of the GW is just a dead stick.
I replaced my UIPEthernet files with the ones from GitHub above, disabled DEBUG and UDP to get it to fit, re-compiled, and re-deployed. Will report back how it goes!
BTW - the statement above says: "•DON'T activate the DEBUG-flag in MyConfig.h because this definitely will 'break' the gateway." I had to turn off DEBUG to fit the code on my UNO anyway, but I'm curious to why having DEBUG on breaks gateways?? (I had DEBUG on in my previous version with the old UIPEthernet files.. Did it contribute to my issue?).
-
RE: Vera - Can't create GW device with UI7 files
Ha! that's funny... I was just looking at that very same thread last night I had found in a search on the vera forums :-). Let me know if you get it solved, and I'll do the same!
-
RE: Vera - Can't create GW device with UI7 files
Thanks for the response. - I've been working with them on the connectivity issues... about three weeks now of back and forth (but very little work, they just go dark for days at a time ). They've enabled the USB port so that I can at least configure the connection.. but it still doesn't work. I'll keep working with them on the connectivity.
My follow up ping was more around not being able to create a device at all with the UI7 branch of the files (i.e nothing happens which I click "Create Device"). Sorry that wasn't clear. Are you saying others have used Vera support for that as well? or just the connectivity problem?
-
RE: Vera - Can't create GW device with UI7 files
88 views and no one has this working?
-
RE: Vera - Can't create GW device with UI7 files
update - after a dozen tries, I got the device to create with the old XML files... however, even after setting the serial/USB port correctly, the Vera says "Can't Detect Device" for the MySensors Plug-in device... still plugging. This should be easier
-
RE: Vera - Can't create GW device with UI7 files
I did notice (no clue if it means anything), but trying to open either D_Arduino1.json or D_ArduinoNode1.json in the Device simulator gives this error -> Cannot read contents of D_Arduino1.json.lzo
but I don't know if that's supposed to work or not.
D_ArduinoRelay1.json opens fine....
-
Vera - Can't create GW device with UI7 files
Hi all,
Vera Edge/UI7, Arduino Nano, serial gateway sketch pretty much unchanged...
I'm toying with the idea of switching from a Ethernet gateway to a serial gateway. After spending time with Vera support to get the USB port enabled on my Edge/UI7 device (long story, well documented in the Vera forums), I can finally try. With the original Arduino Vera files (the XML and JSON config files), I can create the device, re-load luup, pick the device in the drop down list box in order to associate it with the serial port, and then re-load luup. When luup is reloading, I get stuck with a line at the top that says "select serial port" (or something like that, can't remember exact error.. it seems that me selecting the serial port in the UI doesn't 'stick')...
I noticed that there was a branch of the Vera files in GitHub that says it's specifically for UI7. I downloaded them, and uploaded them to Vera, and restarted luup. My Ethernet gateway still works, and now has prettier icons :-). However, when I try to create a new device for my serial gateway, it doesn't work. I click on Apps->Develop Apps->Create Device and type D_Arduino1.xml in the "Upnp Device Filename" field. I click Create Device and I get a pop-up from Vera saying the device was created. But nothing happens. No device gets created. I re-load Luup.. nothing happens. still no device. pretty much acts as if I did nothing.
any advice? ideas?
(I'm obviously not keeping both gateways long term.. as soon as I get the serial GW created, I'm dumping the other one.. but right now, I haven't yet deleted the Ethernet one... think that's the issue?)
-
RE: Having trouble with Ethernet Gateway/Radio/SoftSPI
Awesome! Glad I could help. Now, if I could just get my own stable
-
RE: Having trouble with Ethernet Gateway/Radio/SoftSPI
ok, cool.. let us know if the separate power helps.
I don't know if it's an issue with the NRF24L01+ radios, but I know some radios actually don't work well if they are too close together (related to the wavelength of the signal). I've never heard of that being an issue with mysensors stuff, but I know, for example, my weather station and the remote sensor won't work if they are within 5 ft. of each other. Maybe someone else can weigh in if that's ever been a problem with the NRF's. I know when I built my first sensor, they were about 2ft apart and worked fine, so that's probably not the issue.
I don't have much more to offer you unfortunately as I'm new as well. I can say that I've got pretty much the exact same setup (including Win 10) with the exception of a different Ethernet shield. Mine is working "mostly* reliably.
-
RE: Having trouble with Ethernet Gateway/Radio/SoftSPI
I'm new to this as well, but i've got a similar setup working pseudo-reliably, so I will throw out a couple of stupid questions for you
- can we assume the sensor is close enough physically to expect the GW to be able to pick it up? (within the radio's range). I would assume you are working on them near each other, but I don't like to assume things
- someone else suggested to me when I was building mine that it might help to power my radio separately from the Uno and shield. I have a 4.5V power supply (what I had laying around) going through a 3.3V voltage regulator (with a 100uF capacitor across the leads) to power my radio separately from my GW. I wasn't having problems with the radio, instead my problems were on the Ethernet side, but it seemed to make the whole rig a little more stable. The belief is that the USB port may not be able to source enough current to power the Uno, the shield, and the radio.
-
RE: Ethernet Gateway - unreliable (sort-of)
@BulldogLowell - Neither the Uno or the Ethernet shield gets hot. I seem to have the same experience no matter how I power it...
@Dan-S - I'm using a ENC28J60 based shield, not Wiznet. I had both. I actually tried to use the Wiznet board first, but it seems to be completely bad (I can't even get any of the built-in Ethernet examples to work with it). I don't have another ENC28J60 board to test with..
However - by way of a small update. I've had the GW running for several days in a row now and have a few updates/observations:
- communication from sensor to GW to Vera continues to work flawlessly.
- I finally got around to adding a sensor that requires commands to be sent FROM the Vera (a variation on the relay actuator sample). Communication from the Vera through the GW to the sensor also works very reliably... So, it seems the problem is not the Ethernet stack or listener. So, the problem seems to be isolated to the inclusion mode and Metric/Imperial buttons.
- inclusion mode now works 'sometimes'. It doesn't work every time, but sometimes setting inclusion mode from the Vera UI works, as opposed to never working previously after the first 30 seconds after a reboot. It seems like it works right as I'm about to get irritated that I have to walk down two flights of stairs to my basement to push the inclusion mode button manually, so maybe the Vera/GW have a 'mood' sensor
I don't know (yet) why it works sometimes and not others. Still troubleshooting. But I'm encouraged that the Vera/Mysensors combination is trending towards more reliability.
-
RE: WITH_LEDS_BLINKING - for gateways only?
Ok, will do... my experience is that TX never blinked at all, and RX seemed to come on for about 20-30 seconds out of every minute. but I'll try to troubleshoot some more when I have time.
-
WITH_LEDS_BLINKING - for gateways only?
Hi all,
For some of my sensors that are fully powered (as opposed to battery powered ones), I'd like to get quick and dirty visual confirmation that they are sending and receiving data. I'm trying to use the WITH_LEDS_BLINKING functionality. But the behavior I'm seeing that transmit never comes on, and receive seems to come on at unrelated and random times. It occurs to me that functionality may be intended for gateways only and tied to some gateway specific functionality. Is that the case? I figured I'd ask before I go digging around in the code to see why they aren't working for me...
thanks,
--Steve -
RE: Ethernet Gateway - unreliable (sort-of)
I can do that, but I'm not yet convinced it's a Vera/UI7 problem (unless UI7 is what's causing the GW to stop listening). I say that because I can't telnet or use the MYSController app to connect to it either. I should be able to connect with those things as well I would think.
-
RE: Ethernet Gateway - unreliable (sort-of)
yeah, since I'm relatively new to home automation, I made the (apparent) mistake of building an Edge. No choice but UI7. When troubleshooting other stuff with long time Vera users, this is the point I usually get to, where they say "oh, I'm running UI5, <insert thing I'm trying to do> works fine for me" and shrug
Apparently UI7 is a big pile of monkey
Thanks a ton for trying to help! I'll keep plugging at it.
-
RE: Ethernet Gateway - unreliable (sort-of)
I do not get any errors after hitting the reload button on the Vera. And it has no effect on the Vera buttons working or not (only a GW reset temporarily fixes that).
One note: I used the Vera device files from https://github.com/mysensors/Vera
Someone from another forum pointed me to the UI7 branch https://github.com/mysensors/Vera/tree/UI7
But when I tried to use those files, I couldn't get the gateway to create.
Not sure if it makes a difference. If so, I can try again
-
RE: Ethernet Gateway - unreliable (sort-of)
I have tried inclusion via Vera, but I will admit not with the 'persistence" you mentioned I might have tried the button a couple of times in a row, but that's it. And it works fine from the Vera button for the first half-minute or so after a restart.
-
RE: Ethernet Gateway - unreliable (sort-of)
Thanks @rvendrame.... For the Arduino + Ethernet shield, at the moment (temporary while debugging), I'm powering both from a USB 3.0 port on my computer. I have also, in an earlier iteration of troubleshooting, also had a switching power supply rated at 9V and 1A plugged into the barrel connector of the Uno in addition to USB (for serial monitor). Behavior didn't change.
Per recommendation by @dan-s, The radio is separately powered by it's own power supply. It's a Enercell supply rated at 4.5V and 700mA. The supply for the radio goes through a LD1117 3.3V voltage regulator and has a 100uF can capacitor across the input leads. I've verified the input of the regulaor at 4.52V and output of the regulator at exactly 3.3V.
Of course, I don't yet have any confirmation that any of the voltages going into either of the components doesn't drop due to inability to provide enough current for the components under load. It's certainly possible I'm under-supplying either component. I have moved my sensor over 100ft away and it still picks up fine for the radio.
The behavior of the gateway is that after a reset, you can telnet into it, connect via the MYSController software, and/or use the Vera software to send commands to it for about 30 seconds, then it starts ignoring all Ethernet-sided input... i.e. it seems to quit listening for network client connections. (although radio traffic and GW initiated network input works fine). A persistent ping to the device during all of this traffic never drops a single packet.
What would be the recommended rating for power supplies for the two different parts of the solution? (Arduino Uno + shield and Radio)
-
RE: Ethernet Gateway - unreliable (sort-of)
Thanks for the response @dan-s. My issue isn't getting the sensor to show up in Vera, that actually worked perfectly. The issue is that communication from the GW to Vera works great, but communication from Vera to the GW doesn't appear to work at all, or at least it is very unreliable.
For example, just to use the inclusion example. If I push the hardware inclusion button on my gateway, Vera immediately reflects the fact that I changed to inclusion mode. If I 'include' any sensors by restarting them, Vera (via the GW) recognizes them immediately. If/when the GW times out of inclusion mode, Vera recognizes it immediately.
The issue comes when I try to communicate the other way. None of the buttons on the Vera plug-in appear to do anything on the GW. For example, I can't start or stop inclusion mode by hitting the Start and Stop buttons on the plug-in UI inside of Vera. The Metric and Imperial buttons appear to not do anything either. Even if I manually change the 'config' variable on the advanced settings page of the plug-in from M to I, it sticks in the GUI, but doesn't appear to get pushed to the GW (the GW still reports M to the sensors). So it appears that nothing is being communicated from Vera to the GW.
So far, I haven't had a chance to see if Vera will send any commands to a sensor/switch/whatever via the GW because the only 'sensor' I've had time to build is a temperature sensor that only sends temps (via the GW) to Vera. It works great. I'm going to try to build a sensor that receives commands from Vera as well as sends inputs, but haven't had time yet (and running out of HW).
so, so summarize (too late, I know).. based on the evidence so far, it appears that communication from Vera to my GW dies soon after reset. I cannot telnet into the GW on port 5003 after more than a couple of minutes after reset either (and the little troubleshooting Windows app, I can't remember the name, can't connect either).
-
RE: Ethernet Gateway - unreliable (sort-of)
Separate power supply for the radio didn't help the stability of the Ethernet Gateway. Telneting into it is spotty. It seems pretty reliable when it updates Vera (i.e. pushing the inclusion mode button, and letting it time out, immediately reflects in the Vera UI). My temperature sensor (the only sensor I've built so far, as a test) very reliably gets updated in the Vera UI as well. However, Vera -> controller communication is spotty. Sometimes hitting inclusion button from Vera works, sometimes not. Metric vs. Imperial button never works. Setting the variable for 'config' in advanced settings may or may not work (gw.getConfig().isMetric always returns 0, regardless of setting). Still troubleshooting that....
-
RE: Uno+ethernet shield = radio init fail [solved]
this is probably an obvious question, but I'd rather insult your intelligence than silently let you make the same mistake I made for a while :-). On your hard drive, and I'm not sure how the second copy gets made (I didn't copy the library twice, or if I did, I was drunk when I did it :-)) , there are two copies of the libraries (and thus the config.h file). there is one in c:\program files(x86)\Arduino\libraries and one in your "My Documents"\Arduino\libraries (or wherever your "my docs" is).... it's the one in your "my docs" that counts. Make sure you are editing the right 'myconfig.h' file when you enable SOFT_SPI.
-
RE: Ethernet Gateway - unreliable (sort-of)
I'm rebuilding my gateway (going to go with a serial gw instead of Ethernet).. but during my limited testing with my Ethernet gateway, pretty much nothing with the Metric/Imperial setting worked as I expected :-). But I think that and my connectivity issues may be related.
-
RE: Ethernet Gateway - unreliable (sort-of)
Nice setup... I'll see if powering my radio separately helps. Right now, the symptoms are interesting. After a reset, I can telnet into the gw until I push a button in the Vera plug-in UI (i.e. either try to "start" inclusion mode or switch between Metric and Imperial). Neither button works, and after that, I can no longer telnet into the gw. The plug-in buttons never work. However, interestingly, if I push the physical 'inclusion' button on the gateway, the plug-in updates immediately to show I'm in inclusion mode. It also updates immediately when inclusion mode expires. So GW to Vera communication is working fine. I can also go into Advanced Settings -> Variables for the plug-in and manually change a variable (say, change the config settings for Metric from "M" to "I") and that setting is reflected in the plug-in (but I can't tell if it makes it back to the GW - I see nothing in the serial monitor, although Vera said it sent the command successfully)...
Really weird stuff....
I'm in the process now of creating a sensor to see if the radio is working and further troubleshoot the GW <-> Vera interaction.
-
RE: Ethernet Gateway - unreliable (sort-of)
I think he was saying to leave the Ethernet shield powered by the Uno, but to power the Radio separately...
-
RE: Ethernet Gateway - unreliable (sort-of)
so you just have a separate power supply, with a 3.3v regulator, powering the radio?
-
Ethernet Gateway - unreliable (sort-of)
HI,
I built an Ethernet gateway and got it 'running' yesterday. I connected it to my Vera via the plug-in. The problem I'm having is, after the first interaction or two, it quits responding. It won't respond to commands from Vera, nor can I telnet into it. After a reset, it responds and works for a short while, but then will no longer respond to Vera or telnet to 5003. A persistent ping, however, works fine and loses no packets.
The interesting thing is, even when the device won't let me telnet in, if I do a luup reset on the Vera, I can see the "Get Version" command run on the gateway (via the serial monitor) successfully. But I still can't telnet in, and none of the buttons (start/stop, metric/imperial) on the Vera plug-in works.
the other interesting thing is, even when the device is 'unresponsive' in terms of telnet and initiating commands from the Vera, if I press the 'inclusion' button on the GW, the Vera UI immediately updates to show it's in inclusion mode. Ditto on 'exiting' inclusion mode after the 1 minute timeout
so the GW is still functioning on some level, but just seems to stop listening for commands/connections on 5003.
I don't have any sensors yet, as I wanted to get the basic communication and integration with Vera working first. So I don't know if the radio stack and other GW functionality works when it's in this state.
Nothing shows up in the serial monitor when I try to telnet and/or send Vera commands in it's unresponsive state.
What is the best way to troubleshoot the reliability issues? Have you guys seen this behavior before? I would normally just blame the flakiness of Vera UI7 (don't get me started), but not being able to telnet points to a gw problem.
Details of my installation are below:
Vera
Vera Edge
UI 7
Firmware version: 1.7.1320Platform -> Arduino Uno R3
Ethernet Shield -> full sized Ethernet shield based on ENC28J60 chip
hardcoded IP address: 192.168.0.215 (my home network is 192.168.0.0/24)
Radio -> NRF24L01+PA+LNA (but have also tried just the plain NRF24L01+ smaller version with same results)- CSN to pin 6
- CE to pin 5
- MOSI to pin A1
- SCK to pin A0
- MISO to pin A2
- using SoftSPI
Operating System - Windows 10 (fresh install last Thursday)
Arduino IDE: 1.6.5 (freshly installed today)
MySensors libraries -> 1.5 (freshly pulled today from master branch)
Radio powered from 3.3V output on Arduino
100uF "can" capacitor across VCC and GND on radio (because it's the only size I had... same results with or without it)
everything powered by USB cable from my computer (so I can troubleshoot via serial monitor)
I have TX, RX, and ERROR LEDs connected between 5V rail from Arduino and 220Ohm resistor to ground -
RE: Ethernet Gateway - Radio Init Fail
Ok... update... I had some debug code in there from when I was trying to find out where the initialization was failing, and I think I introduced a bug... I removed my code and re-ran and got this:
0;0;3;0;9;gateway started, id=0, parent=0, distance=0
that looks good :-)...
thanks for the help guys!
-
RE: Ethernet Gateway - Radio Init Fail
disregard the note above about not being able to ping or telnet to the gateway... that was user error :-)...
the question still remains about the gobbledygook in the st param of the 'gateway started' message. is that legit?
-
RE: Ethernet Gateway - Radio Init Fail
thanks for the clarification and help, guys.. You guys rock with the quick responses! (and Mysensors in general is friggin' awesome!)
I moved the wires and enabled SoftSPI and got further than I was. I managed to get to the hallowed "gateway started" message, but got gobbledygook for the st param.. this is what got printed..
0;0;3;0;9;gateway started, id=0, parent=0, distance=0
c=327,t=310,pt=288,l=273,sg=631,st=»:qmjëlVúšÚö�iÿïs0¼�÷ïÜžºKmýÏO»rgædöûå=_ošóÕëÖÌ›§2ŒT†—<÷¿Îºô}~Bõò>,{÷5/does that look right? or an issue? what does a 'working' gateway look like (without yet having any sensors or connecting to Vera)? Should I be able to ping it? (I can't) Should I be able to telnet to port 5003? (I can't)
-
RE: Ethernet Gateway - Radio Init Fail
Thanks for the response...
From the gateway wiring guidance page, I thought the SPI issue was only with the Wiznet based Ethernet shield. Is that not the case?
I'll give the SoftSPI route a try. Thx for the quick response.
-
RE: Ethernet Gateway - Radio Init Fail
@stevebus Meant to add a couple more details
- this is all on a breadboard at the moment. prototyping before soldering it all via PCB
- LEDs are connected to pins 7, 8, and 9
- I get the same results in the serial monitor if I unplug VCC and GND for the radio!!.. Is this the first place in the code that we try to talk to the radio?? (not having a step debugger stinks )
-
Ethernet Gateway - Radio Init Fail
HI,
I'm just putting together my first mysensors project. I'm starting with the gateway first and trying to put together an Ethernet gateway. Here are the specifics and troubleshooting I've done.
Platform -> Arduino Uno R3
Ethernet Shield -> full sized Ethernet shield based on ENC28J60 chip
Radio -> NRF24L01+PA+LNA (but have also tried just the plain NRF24L01+ smaller version with same results)- CSN to pin 6
- CE to pin 5
- MOSI to pin 11
- SCK to pin 13
- MISO to pin 12
Operating System - Windows 10 (fresh install last Thursday)
Arduino IDE: 1.6.5 (freshly installed today)
MySensors libraries -> 1.5 (freshly pulled today from master branch)
Radio powered from 3.3V output on Arduino
100uF "can" capacitor across VCC and GND on radio (because it's the only size I had... same results with or without it)
everything powered by USB cable from my computer (so I can troubleshoot via serial monitor)
I have TX, RX, and ERROR LEDs connected between 5V rail from Arduino and 220Ohm resistor to groundSteps I've done
I've updated EthernetGateway.ino to account for the ENC28J60 chip instead of Wiznet per the comments (i.e. UIPEthernet, etc)
I've uncommented WITH_LEDS_BLINKING in MyConfig.h
compiled and uploaded to Unoin the serial monitor, I get "0;0;3;0;9;radio init fail"
I put in some Serial.println's to find out where it is failing, and it is failing in the call to rf24.isPVariant() in MyTransportNFR24.cpp
if (!rf24.isPVariant()) {
return false;
}the call to isPVariant is returning false, and the code just bails at that point (falls out to a while(1)). looks like the p_variant variable is set as a result of the call to SetDataRate in rf24.cpp... So it looks like the code is failing to set the data rate (and maybe other config params) on the radio for some reason. I tried it with both the antennae and non-antennae versions of the radio with the same results.
That's where my troubleshooting capabilities start to run out
Any further ideas?