Do yourself a favor and look up Ben Eater on Youtube.. Ben has a series of videos explaining computers starting at the digital logic gates and builds a complete but minimalistic microprocessor out of simple logic chips, and then walks through writing a small program (the computer only has a few bytes of RAM!) https://www.youtube.com/playlist?list=PLowKtXNTBypGqImE405J2565dvjafglHU Then, he also has another series that expands upon this and uses 80's era parts which are still available to build a simple computer with more capability. https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH Best of all, he sells kits that you can get to "play along" and build with him. The videos are amazing for a beginner or an experienced viewer. I've been a computer geek since the very early 80s and yet I really had no idea what the "microcode" in a CPU did until watching these videos. He explains things so well!
Posts made by 172pilot
-
RE: How to learn how computers and hardware works from a low level?
-
RE: Good thing mysensors has non-repeatable encryption....
@Anticimex I 100% agree on the "totally protected" but since the issue, at least as far as protecting from the "kiddie toy" that was the subject of the original thread, I'm just saying to ONLY add a cheap level of protection that would prevent a basic record/playback of a valid signal, I'd think this would work... for free.. I totally get that a real signature system would be better, but at a significant cost and effort.
I dont know the bits and bytes of MySensors well, but I took as implication from the discussion that decryption of the packet wasn't the primary concern against this particular attack because you're right - If you can decrypt, it's over, especially if it's a single shared key amongst all the devices.. -
RE: Good thing mysensors has non-repeatable encryption....
@NeverDie Is a signing chip really necessary?
If the packets are truly encrypted, and the hack you're trying to foil is a simple replay attack, I would think that including a simple incrementing counter into the message would do it. All the receiver would have to do is to only accept decrypted messages with a counter number GREATER than the last one it received. This should be simple to do if the encryption/decryption is already considered relatively secure? -
RE: Requesting a garage door sensor type.
@dbemowsk said:
@172pilot So you don't have the node set to close the door at a certain time of the day?
Nope.. My current system was an old arduino uno based thing that I only did for the RFID and auto-close timer.. I've never successfully gotten one integrated with Vera or MySensors so it really hasn't been an option.. I probably will once I get all this done.. Hopefully as a Vera Scheduled event
-
RE: Requesting a garage door sensor type.
@dbemowsk said:
@172pilot I like your idea of putting the timer logic on the node itself, but do you have a way to set that from Vera? If not, I would have to reprogram the node if I ever wanted to change that.
I have the timer hardcoded in the node to 3 minutes, but I have a button that disables the timer until the next time the door is closed, which is how the one I've been using for the last 6 years works, but the new version I'm working on, I'm thinking of also making it so that if I manually stop the door between the limits, it wont start the timer..
-
RE: Requesting a garage door sensor type.
@RoushRS3 said:
@dbemowsk
Hi there I built a garage door opener sensor using the "Relay Actuator" sensor from the "Built" section ,Yeah.. With that, it's just a device to open/close your door, right? Can you use that to detect the state of the door? (open/closed) And as for the button, yeah.. I haven't looked hard, but I think a "doorbell' kind of device object would be perfect, but I haven't seen that..
Ultimately, a full implementation of a garage door object would be awesome.. I just wish I knew where to start..
-
RE: Requesting a garage door sensor type.
@dbemowsk I'm on a VeraLite controller, but have been thinking of switching to the plus too.. Having the object type defined in MySensors and Vera would be very nice, but that is beyond anything I've done in either environment.. I'd love to learn though, so if there's any way to contribute, I'm all ears.. forcing garage door functionality into a 'switch' type object just doesn't quite fit the bill..
One difference between your concept and mine I guess is that my close door timer logic is built into the sensor itself... I didn't want any communication problem with a controller to accidentally leave the garage open. If the sensor is working, it is self sufficient.. One other thing I didn't mention is that I've got an RFID reader on it so that I can open the door with an RFID token.. Not sure how or if this would fit in to a garage door object.. In a perfect world, I'd love to manage the list of active tokens on the host side, so it might make sense to have the RFID section defined as a separate device that then remotely triggers a garage open event..
All this activity on the thread has inspired me to bring back up my old code and check it out after 3 months of walking away, and I think I may have found my reboot problem - I think I'm using the generic softwareserial to read the RFID reader.. I think there's a specific ESP SoftSerial module that may work better.. Maybe I'm tripping the WDT.
If there's a place to post my code for comment or inclusion into someone else's code, I'd be happy to do so.. It's messy but maybe having others look at it will help, and/or someone who is more famliar with the MySensors stuff can help put in the hooks to the controller. Right now, I have removed all the MySensors stuff for troubleshooting my basic functionality and reboots..
-
RE: Requesting a garage door sensor type.
@dbemowsk said:
@Redguy That is why I proposed the 5 states (open, closed, opening, closing, and obstruction).
That sounds like exactly what I wanted, except that because I wanted to always have an automatic close timer, I decided to take the short cut that if the door wasn't fully opened or closed (neither sensor tripped) the code would basically go idle, so that if I set the door just a little bit lower than fully opened (manually stopping ir) that would be my easy override for the auto-close code, and assuming I hadn't manually interfered, the door would eventually be fully closed or open again.. If it found an obstruction and auto-opened, then being in the open state again would start the auto-close timer.. So, for example if I come home, and close the garage and go in the house, but the cat breaks the beam on the way down, it would automatically attempt to re-close after the standard 3 minute timer..
I hadn't considered trying to determine if that happened, but I guess if I added enough code to remember if the last state was open or closed, it would be easy to figure out if the close action was aborted..
Anyway.. Do you have working code?? I think mine actually does work, but I'm just having the 8266 reboot problem for some reason.. I haven't touched it since maybe September, but I should really get it back out and finish this thing up!!
-Steve -
RE: Requesting a garage door sensor type.
@Redguy Yeah.. that sounds like the roller shutter code would be good for that.. For mine, although I havent had time to finish it, my logic was that I had a sensor for completely up and one for completely down, and if neither was tripped, I just considered it "in motion".. I did this because I wanted a timer so that if the door was left open for more than a few minutes, it would automatically close... If I am working in the garage, I would just manually press the button to lower the garage door an inch or two, which would tell my sensor NOT to automatically close, because it's already in motion..
All of my recent troubleshooting has been because for some reason my 8266 seems to want to reboot randomly (sometimes once an hour, sometimes once a day) and when that happens, it triggers the IO pin and opens the garage.. In practice, it would auto-close, but it's still not a good idea for my garage to be opening randomly!
-
RE: MySensors 2.0 Ethernet gateway Atmega+W5100) restart all time
@fleshfear said:
sorry to ask, but how do you down grade?
In your arduino IDE.. Choose Tools, Board, and at the top of the list, choose board manager, click in the window for "Arduino AVR Boards" and it will give you a pull-down for 'version' in the bottom left. Choose your 1.16.11 version, and click install..
This worked for me.. Maybe there's a newer one now with the bug fixed, but for me this older one works!
Good luck!!
Steve -
RE: Adding MySensors to existing arduino project? Minimal code needed?
Thanks for the reply.. It seems that if you can do what you did with the sensor code, presumably it should work with the gateway code, so I guess I just need to make some time to try some more.. Otherwise I think i'm just going to have to move back to a bigger arduino and just use an NRF and forget about the wifi on the new version..
Thanks!
-
Adding MySensors to existing arduino project? Minimal code needed?
Hi, I've got a working Arduino based garage door opener project that I'd like to connect to MySensors for monitoring and control..
It ran before on a plain Uno, with a wifi module that I can't remember the name of, which was in a Zigbee form factor, and was a serial Wifi interface.. I'm in the process, and almost done migrating to a new Sparkfun 8266 Thing Dev board so that the Wifi would be built in, and I could more easily socket the microcontroller to remove it without unwiring the whole thing from the garage when I need to make code changes, which is how my Arduino currently is..
SO.. My goal being that I want to monitor and control the door, I naturally thought I'd make a sensor node, but I dont have enough IO pins left over to support an NRF radio module, so I changed sights and decided to try to make it a WiFi gateway that would just report on itself, since it's already connected to my WiFi..
I thought I could just add:
#define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 185
#include <MySensors.h>to my existing arduino project, and then hopefully add the code to register the devices and go from there, but it's not working.. I realize I dont know enough about the MySensors code to be able to retrofit my project like this. I've looked, but can't find anything that specifically talks about retrofitting an existing project like this.. Is there something out there that I'm missing? Any cookbook for the minimal required code to do so? If not, I think I'm at the point that I'm going to have to start over with the MySensors gateway sketch, and then import my "business logic" into it.. Maybe that's the easiest way??
Any help would be greatly appreciated!!
-
RE: Requesting a garage door sensor type.
@dbemowsk Any info on how your garage project went, and whether you used the roller shutter code? I'm in a similar situation now.. I've got an 8266 "Thing Devboard" (Sparkfun) based garage door controller that I'd like to integrate with MySensors.. Ultimately, I'd LOVE 2 things to show up on Vera: 1: an indication of state (open/closed/in motion) and a pushbutton to let me trigger the relay for open/close..
I originally started searching in here for a "pushbutton" type interface, since I didn't really want to use an on'/off switch type thing, since it was supposed to be momentary, but then I saw your post about a request for a real "garage door" plug in..
Just curious what you ended up doing..
-Steve -
RE: MySensors Mini Scene Controller
Thats perfect.. definitely have to try this.. Thanks!!
-
RE: MySensors Mini Scene Controller
What kind of box is this? I'm having a hard time visualizing the scale of this, but does it use something roughly the size of an outlet cover? This looks exactly like what I want to build..
-
RE: Using the 3.3V pin to power NRF24L01+
For the purposes of low power mode, does the mysensors code put the NRF radios into low power mode when not in use, and so even if powered by the constant 3.3v, it will be using minimal power? I've got a project that I thought would run for several months on a battery, but it dies in a few days, and I'm trying to track down the cause.. I am sleeping for 15 minutes between transmits, and just want to make sure there's nothing specific I should be doing to put the radio in low power mode?
-
RE: MySensors 2.0 Ethernet gateway Atmega+W5100) restart all time
Thanks! I've been frustrated all day, watching my UNO with 5100 based shield continuously cycle through:
0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
0;255;3;0;9;TSM:READYOver and over, about once every 2 seconds.. Just downgrading to the 1.16.11 version, and it seems to have fixed it.. Still waiting to see the first comm with the Vera, but, so far so good!
Thanks!
-
RE: Raspberry Pi Ethernet Gateway
Yep.. misunderstood.., I thought you were basically saying "why would you use a pi instead of an arduino when the arduino uses less power, etc..."
-
RE: Raspberry Pi Ethernet Gateway
@GertSanders said:
using a raspberry as a gateway only would be a waste of processing and electrial power, since there is an ethernet gateway based on Arduino possible, which takes less electrical power and is just as capable and more stable.
It's only a waste of power if there's not already an RPi there doing other jobs.. One reason I came here today looking for RPi gateway code is that I already have a pi sitting where I want to put a MySensors ethernet gateway, and I thought I could do without another arduino, power, etc..
-
RE: How to - Standalone node on esp8266 using wifi only - sketch problem
I am having the same problem... same exact error, but on a Sparkfun Thing Dev board 8266.. Trying to put the include up above in the GatewayESP8266 code didn't work..
I've uninstalled everything arduino, including the Arduino15 directory under the AppData\Local directory, and have installed completely from scratch...
I can't be the only one having this problem still, am I ? Anyone know what's going on?
Thanks in advance.. I feel SO close to having this working!!
-
RE: ESP8266 gateway - Connection refused
So.. I am VERY confused.. The 8266 wifi gateway doesn't have to have my zwave controller (vera UI7) ip address defined anywhere? I used to have this working, but just started over with the released version of the 2.x code, so I deleted EVERYTHING relating to arduino and MySensors, and started over.
With the generic GatewayESP8266 code, as soon as I enable the "#define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 185" which I thought was what was telling the code where to gind my Vera, it no longer compiles, but from what I think you're saying in this thread, I dont need to do that? Without my controller IP configured, it does compile and upload, and it connects to my WiFi, but then it just sits there doing "SANCHK:OK", because (I think) it doesn't know where to connect to the Vera... My Vera is configured with the IP of the gateway (192.168.1.106:5003) but it just keeps saying "Cannot Send command - Communications Error".. What am I missing?I read that "client" mode is new.. maybe I am messing up my "MySensors" terminology, but shouldn't the 8266 need to know where to talk to Vera?
-
RE: Example of V_CUSTOM
Well.. My initial use is for a pool temperature / level sensor.. The temp is easy - It's registering as a V_TEMP and working great, but what I want is for the level to say "1.5 inches low" or "2 inches high", etc.. I currently have the value implemented as another V_TEMP, and have my arduino code calibrating the code to show 0 degrees if it's "perfect" and then plus/minus one degree for each inch the pool is high or low, but to have a sensor that is named "Pool level" and the data being "1.5 degrees F" isn't intuitive. I thought about using a distance sensor, but I couldn't get the distance code to work in the first place, and then I'd have to just remember what "distance" is normal (ie: is 0 the "top" of the pool, the the distance represents how far down the water is?) It just seems simpler in many cases to have a few english words displayed in the Vera website.
Another idea I have is to replace all my "expensive" z-wave door sensors with MySensors on Pro Mini because I hate that the output of the door sensor is just a picture of the door sensor with the "rainbow" on top either colored red, or not, and I have to remember which color is "open". I'd rather have a Vera output that just says "OPEN" or "CLOSED" and I can't figure out any way to do that with the regular sensors so I was just going to build my own..
I'm sure I'll think of more, but that's enough to keep me busy for a while!
.. didn't get to try any of this last night as I had hoped.. we ended up going to the town carnival instead... Will try again tonight!
-Steve -
RE: Example of V_CUSTOM
AWESOME!
Thanks a lot! I'm already using Dev branch, so this should be easy to test!
I guess I know what I'm doing tonight!
-Steve
-
Example of V_CUSTOM
I want to make a device in Vera UI7 that shows up with arbitrary text. I can't find a pre-defined data type that seems to let me do an arbitrary string, but I see this "Custom" type, but I can't find any way to use it or examples on people using it like I'm talking about..
I thought maybe it would be as easy as some code like this:
//define and present MyMessage msgCustom(0,V_CUSTOM); present (0, S_CUSTOM, "Custom String Sensor"); //and then use it like this: send(msgCustom.setSensor(0).set("Hello World"));
BUT.. This doesn't seem to work. I'm only beginning to learn this stuff, so maybe there's a total newbie error in here..
Can someone point me to an example sketch that perhaps gives the ability to return arbitrary string values to the Vera dashboard?
Thanks!!
Steve -
How to use DistanceSensor?
I have a custom water level sensor I'm working on for my pool, and was planning on presenting it as a "Distance Sensor" to MySensors/Vera.. It seems to be working, but on Vera, I get:
"GET_LANG(system_error,System error) : Device: 84. Fail to load implementation file D_DistanceSensor1.xml"
I did find where it said I need to download the 3 files from GitHub, which I've done, and uploaded them to Vera, but I'm still getting the message, even after removing my sensor from Vera, rebooting, and letting it re-detect. A second (temperature) sensor on the same Arduino is reporting correctly..
Can anyone give me guidance as to what might be going on?
Thanks!
Steve -
RE: gw.sleep on battery powered magnet door switch
@treb0r the problem is, you need to wake up the arduino to tell the temp sensor to take a new reading, so the best you can do is to trigger on the interrupts for the Windows and then use the timer to wake up and take the temperature reading, and then you'll have to compare to your saved value to decide whether it has been 5 degrees or not, so you can't completely sleep until that happens..
-
RE: gw.sleep on battery powered magnet door switch
@AWI I was going to ask about that.. I dont see any reason to wake up every 24 hours just to go back to sleep again.. I assume the radio doesn't have any reason to send a keepalive or anything? So, you can omit that number, and it will sleep until interrupted? That's cool..
-Steve
-
RE: [SOLVED] ESP8266 WDT reset
@AffordableTech @Yveaux
Thanks!I uninstalled Arduino completely, deleted everything I could find, and reinstalled from scratch, and after a bit of patience and rebooting the vera, I now have a functioning Wifi gateway using a Sparkfun 8266 Thing Dev board, and an NRF radio.. Then I was able to build a quick "Arduino switch" with an Uno and an NRF just to test, and it works great!!
Now it's time to get creative and build some stuff!
Thanks again!!
-Steve
-
RE: [SOLVED] ESP8266 WDT reset
@Yveaux Thanks.. Good to know what I'm doing SHOULD work..
I have been storing everything in what I think is the default directory, which under my \users\sjones\Documents\Arduino\libraries. This is what the Arduino IDE is pointing to.
Under that directory, I removed the MySensors directory and extracted the new 2.0 one.. BUT, I do see that there are more modules than just those under MySensors, so even though I think those are supposed to NOT conflict with the default ones, I missed one?
Also, I dont understand why, but I see SOME arduino extension stuff under \program Files (x86)\arduino although I didn't see any MySensors information..
And, the only other thing I saw which I didn't know how it got there was the one referred to in the error: "C:\Users\sjones\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WiFi" Since that specifically was referred to in the error, I thought maybe I had an old version there, so I renamed the ESP8266Wifi directory to "old", figuring that whatever put it there in the first place would replace it with the current version if needed, but it didn't happen - it just failed to compile, complaining that it was missing, so I put it back..
I'm not near my home computer now, but maybe when I get home I'll try with a completely new windows profile (create a new user) and reinstall Arduino from scratch
Thanks for your help and patience!
-Steve -
RE: [SOLVED] ESP8266 WDT reset
@Yveaux
Thanks for the response.. I actually did get the 1.5 to at least come up, by putting some WDT resets around in various places that may take a while in a loop, for example, BUT, based on yours, and several other recommendations, I decided to try the 2.0 dev branch.. I deleted everything in my librarys\MySensors directory, and downloaded the DEV branch, and re-extracted the code, and now I can't compile.. I'm getting this:Arduino: 1.6.9 (Windows 10), Board: "SparkFun ESP8266 Thing Dev, 80 MHz, 115200" Build options changed, rebuilding all In file included from C:\Users\sjones\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39:0, from C:\Users\sjones\Documents\Arduino\MyDevelopment-2-0-GatewayESP8266\MyDevelopment-2-0-GatewayESP8266.ino:70: C:\Users\sjones\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WiFi\src/WiFiClient.h: In instantiation of 'size_t WiFiClient::write(T&, size_t) [with T = char*; size_t = unsigned int]': C:\Users\sjones\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:163:66: required from here C:\Users\sjones\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WiFi\src/WiFiClient.h:123:36: error: request for member 'available' in 'source', which is of non-class type 'char*' size_t left = source.available(); ^ C:\Users\sjones\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WiFi\src/WiFiClient.h:127:5: error: request for member 'read' in 'source', which is of non-class type 'char*' source.read(buffer.get(), will_send); ^ exit status 1 Error compiling for board SparkFun ESP8266 Thing Dev.
I found some recommendations to put the "#include <ESP8266WiFi.h>" close to the top, and it fixed it for other users, but I'm having no success with that..
Any idea what this may be?
Thanks in advance..
-Steve -
RE: Uno as serial gateway? Can it also be a sensor node?
@hek Awesome!! i didn't want to get hooked on a feature that would never be supported, but I love to test out the new stuff.. I'll install it tonight!
Thanks!
-
RE: Uno as serial gateway? Can it also be a sensor node?
@hek Is that because it's meant to ONLY be used in the development branch, or is it a new feature that just hasn't made it to the stable branch yet?
-
RE: Dumb beginner conceptual question...
Thanks.. I did break down and order 10 of the nrf radios last night... should be here tomorrow.. In thinking it through more, it seems that it's shortsighted of me to want everything on Wifi just because it's familiar.. I'd end up needing eventually to possibly expand my subnet, have to be reliant on an access point that is probably being killed by my son playing online games, etc.. I'm sure there's a learning curve to the NRFs, but from what I read about their low power requirements and the advantage of all of the self healing, it seems it's the right way to go..
Thanks for the info!
-
RE: [SOLVED] ESP8266 WDT reset
I THINK I'm having the same problem.. I'm building my first WiFi gateway.. I used a Sparkfun Thing Dev board because it was handy and accessible. Only oddities were that since the Sparkfun board has an LED on GPIO 5, I set the LED pin to 5 instead of 7, and the inclusion pin to 2..
I haven't tried the dev branch (will do, and report back) but with 1.5, I get a connection to my wifi, then a reboot:
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ldOver and over again.. Vera says it's connected, but then says it cant communicate. As mentioned, this type of problem is usually a tight loop not giving time for the WDT on the 8266 but I'm not familiar enough with this code to track it down.. Any ideas?
-Steve
-
Dumb beginner conceptual question...
Hi, sorry if this is in the wrong place, but I didn't find a board for newbie Q/A.. I did try to search, but I didn't find anything that quite answered my mental lapse..
I've got a "beginner" Zwave system with a Vera UI7 controller running a few lights and door sensors, etc..
My goal is to automate everything from the toaster to the cat (ok, not really, but you get the idea) and I'm familiar and comfortable with Arduino, so I stumbled across this site, and I like what I read about the self-healing aspects of the MySensor network, but in thinking it through further, it seems that the self healing aspects must be dependant on using the "nRF2401" for radio communication? I had envisioned using the small form factor 8266 WiFi devices for many of my sensors, just because I have a stack of them, and they're directly wifi, but if I do that, I'm depending on every sensor having direct access back to the access point, and the IP network, right?
If that assumption is correct, then am I also correct in saying that every Wifi device would be a distinct gateway, and need it's own instance directly in Vera? If I have 10 or more of these, that could get messy and complicated, right? What is recommended? If I'm thinking this through correctly, I think I may want to use the 2401 modules afterall, and only have ONE gateway defined on the Vera, right??
Sorry for what is probably a dumb question, but this whole thing looks so customizable that it's pretty intimidating for a first timer!
Thanks!
Steve