Nevertheless I must review all my code.... It's been working for a time... But lately it freezes again
Posts made by jhonnygolpe
-
RE: Arduino freezes when I'm writing EEPROM
-
RE: Arduino freezes when I'm writing EEPROM
It's a
do { ...t } while();
loop. It's similar to the while, but with this one you can control that the routine inside the do{...} it's always executed at least once.
-
RE: Arduino freezes when I'm writing EEPROM
Not really... inside the do loop, that it's repeated anytime, updates valueU and nowMillis values, so it's not an infinite loop.
I think it was a problem with the receive function... after callingelse { moveBlind(dimvalue); return; } }
the moveBlind function I missed the return;
Now it seems to work fine.... I'm sure I'll have some more errors, but i'm satisfied by the moment.
Thanks a lot to everybody -
RE: Arduino freezes when I'm writing EEPROM
[EDIT] I've found that I missed a return; call on the receive() function... and now it's working fine...
Really I'm not sure where it fails. And yes, the next step it's write a lot of 'DEBUG'. I've tested changing the eeprom address with the same results, so I'm assuming the fault it's in my code
But always falls after a downAction movement... -
RE: Arduino freezes when I'm writing EEPROM
Well, i'm working with Arduino Uno, directly connected to the 220V/5v converter, so the power can't be the problem. I will enclose the code, and to help the reading of it, i'll try to explain it. On the Arduino there are connected a DHT22 sensor, and 2 relays and 2 buttons to control the blinds. I'm using my former motorized blinds, with its wall-mounted controllers (now one button to UP, another to DOWN). I want to use the previous controllers, and add remote control to move the blinds. So in the loop() function, I check if any of the buttons has been pressed, or if it's the time to send some info to the gateway. I use to have problems when I move down the blind remotely, with the receive function. With the debug activated, it seems to freeze after finishing the downAction() function...
By the time, I'm gonna try the code with another arduino and another EEPROM address.
As you will see I'm using another DEBUG class, very similar to the mysensors'oneSerialDebug.h blindsControlEL.ino -
RE: Arduino freezes when I'm writing EEPROM
Hi again. I've just tried your advises and, of course, I've solve my compilation errors. Thanks for your help !!
But I can't write and rewrite the EEPROM correctly yet. It seems like I'm writing on a new address an y time, so in 2 or 3 times of savind data, arduino freezes.
Now I've defined#define EEPROM_LOCAL_ADDRESS 2
and after just 2 or 3 times of using
saveState(EEPROM_LOCAL_ADDRESS, (uint8_t)newPosition);
arduino freezes.
I've a test code, very similar, but without saving or reading from the EEPROM and works fine, so I suppose it's my fault using correctly those functions.
Thanks again -
RE: Arduino freezes when I'm writing EEPROM
just tested.... when I replace EEPROM_LOCAL_ADDRESS with EEPROM_LOCAL_CONFIG_ADDRESS, I get some compile warnings, all with the same text:
warning: large integer implicitly truncated to unsigned type [-Woverflow]
but the code it's uploaded. But again it freezes by the first time that saveState(EEPROM_LOCAL_CONFIG_ADDRESS, 0) is used. -
Arduino freezes when I'm writing EEPROM
Hi. I'm trying to sa#define EEPROM_LOCAL_ADDRESS Insert Code Here
(EEPROM_NODE_ID_ADDRESS+8)
and saving like:
saveState(EEPROM_LOCAL_ADDRESS, (uint16_t)newPosition);
but always after a saveState instruction, my program freezes.
I don't know if mysensors uses all the EEPROM area and so my code generates a problem with it.
Any help would be apreciated.
thanks -
I need a dual communication example...
Hello. I'm newbie with mySensors. I need my sensor nodes to be able to transmit their states (as Humidity sensors, for example), but most of the time they'd been waiting (and listening) for instructions from the gateway. I'm sure it's a common issue, but I can't find an example doing that: Nodes waiting for instructions from the GW, and reporting state every XX seconds to the GW.
Thanks a lot in advance