-
-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP8266 Client program #152
Comments
this is amazing i cant wait to try it. and just wondering which version of ESP8266 you are using? thanks and my apology for the stupid question |
I am using the ESP8266-12E on a NodeMCUv2 Development board. But it shouldn't matter what kind of ESP chip you have as long as it has ~100 KB of space on the Flash chip for the SPIFFS. It should be possible to reduce the installation procedure down to only installing PlatformIO though so I'll look into that the following days. |
thanks for the feedback, |
I am planning on running it on a battery and measured the battery drain to be about 80mA whilst scanning on the NodeMCUv2 (@5v). That results in a solid 24h of tracking time at an interval of ~2s between position updates (estimation that does not take the battery degradation into account though). The standby drain (not in range of the configured WiFi) is approximately 4mA so that should last just over a week on the same battery and since you will not be home all day long you can expect about 2 days. It might be that the hostname is not correctly resolved when you join the WiFi the ESP8266 created, I'll investigate that in a few hours. |
Okay so I just investigated and since I cannot convince the linker to just flash my binary blob into the flash chip along with the sketch (because it attempts to load the file into the DRAM which obviously overflows at >100KB). That basically means that I have to use the SPIFFS to store the webpage. As you can see in this image If anybody knows how to flash directly to the EEPROM let me know @Abulrock
Note that on windows that would be
|
thank you very much for all your help. |
Nope, you didn't I just noticed that a few minutes ago and added the default password and username to the README. It's |
There is an |
Thanks :) |
i think its solved, right now i'm learning rooms. |
Ahh okay, that makes sense there. Since Actually, how did you connect to the ESP? Did you change the default config in the defaults.cpp? Currently, I cannot manage to reach it when connected to the FINDTracker238109321 WiFi network...that's what's making me a bit perplex on how you managed to do it 😆 EDIT: |
i think so, because when i was adding a port at the end it seemed to load then fail, until i changed the URL. |
Yeah, the configuration is persistent. If you enable tracking it does all kinds of things to preserve power like switching to a longer and more low power sleep period (ESP's MODEM_SLEEP) and after a reset it disables the AccessPoint. Additionally it goes into deep sleep mode when it cannot reach your preconfigured network so keep that in mind when carrying it out of the range of your home WiFi. In order for DeepSleep to work properly, you have to connect GPIO16 to the reset pin. If you don't it'll enter an everlasting sleep until you press the reset button 😄 Okay. I now changed it so that you can actually access it using the AP it creates via a static IP. That is supposed to work now I'm unsure about my semi-bricked ESP though....since I do not have a third one for reference I cannot confirm it. You could try it out by disabling tracking, resetting your ESP and then connecting to the WiFi it created (in the realms of In order to fix the findtracker/ URL not being available when using the hotspot I'd need to add a DNS server onto the ESP8266 but for some reason that renders it unusable as soon as I call dnsServer.start. No idea why but I guess for the initial configuration I'll just stick with the static URL for now. |
i uploaded the new code and tried again, but i keep having issues trying to connect to the esp network, it asks for a password. (it could be my laptop) then some times it might let you log in without one. Findtracker/ still not working but you can access it via 10.10.10.1. once logged in the Learn doesnt work you cant reach the server for some reason. but disconnect from the ESP network and access it via the IP the WIFI router assign and Learn works fine. on the other hand Mr. Aliexpress delivered today some ESP8622 link so i thought i'll give it a try and upload your code into it and after some trail and error i got it working :) |
It is normal that learning doesn't work when you are connected to the ESP network since you cannot reach your configured tracking server (ml2.internalpositioning.com). Regarding the login sometimes asking for password only infrequently: I suppose you are referring to the configuration website login right? Your browser caches the login information and dumps it after a specific (unknown) period of time or when changing hosts (e.g. 10.10.10.1 is a different device than your own WiFi IP). Regarding the config page being highly inaccessible when using the 10.10.10.1 (the bug I had with my other ESP) it is only appearing when the ESP runs in AP_STA mode (aka it runs as AccessPoint and WiFi client at the same time) which is totally weird. Might be due to my power supply delivering too low of a current (Laptops USB port). Unfortunately, the ESP01 you linked does not provide you with access to GPIO16 directly. That means that you have to manually hook up the two terminals on the PCB if you want to utilize it. Have a look at this article, in the picture, there is a green arrow which indicates the pins you'd have to connect. I'll include an option in the defaults.hpp to disable deepSleep though if you don't want to tinker with your board ;) What is your power consumption at? Mine hovers at round-about 80mA @ 4.8V whilst scanning. That roughly corresponds to 24h on a 2000mAh battery. |
I added in a script to set the WiFi SSID and passphrase of your personal network to the repository and will eventually replace it with a very minimal website later on. This script is intended to be used when you are connected to the ESP8266 Hotspot and automatically reboots the chip after it set the values. |
i uploaded the latest files and everything was running ok for a little while, then all of the sudden the wifi drops and the blue light blinks around 1sec. i saw you mentioned that its because its looking for the network but nothing changed while i was sitting it just cut off. anyways i tried to login into the ESP network but the page just loads but nothing happens. thanks for the tip on the ESP 01, i tried to hack it like it showed in the pictures but i dont think it worked. it's pulling around 180mA, which is way to high the nodeMCU pulls same as you around 75 -80 mA. |
Regarding the LED is it blinking in an interval of 1s aka 500ms off and 500ms on? I experienced issues with the page loads via the ESP network as well and haven't found a solution for that yet. It seems to be related to some instability of the network since the connection between the two just drops when I start transmitting large amounts of data (the webpage). Eventually, I will just replace the somewhat complex and feature complete config page with a simple "configure your WiFi" page with the sole purpose of getting the ESP connected to your network. The learning has to be done after that step anyways so I guess that's the best solution. Did you make sure the ESP8266 is in range of your WiFi network (sometimes it just freaks out and the connection drops frequently a few rooms away, other days it works fine for me....bit weird)?
you might need to change |
btw I just pushed some commits that should stabilize the connection to the configuration AP and replaced the configuration page with a basic config page for the WiFi settings only (when those are set and the ESP is connected to your WiFi you get the full blown config). And I had some problems with my NodeMCU not connecting to my home network as well. Seems weird. No idea why though. Might be because of the small antenna but since other people are getting insane ranges with it I doubt that's the root cause. Regarding your high power usage, have a look at this post. It describes nominal power draw of just the ESP8266 chip. It somewhat corresponds with my results (and yours from the NodeMCU) if we add some power for the UART chip on top. When measuring the ESP01 did you take the different voltage into account (or did you measure in-front of the voltage regulator?)? Since 180mA @ 3.3V correspond to 0.6W which would be around 120mA at 5V. Still, it should be way lower since the NodeMCU contains a UART and voltage regulator drawing additional power which the ESP01 board you linked does not have. |
i figured out the issue with power consumption, first i was using a step up to 3.3v with two AA batteries and since ESP uses a lot of current the step up needed more power. when measuring from the battery directly the mA was very high but when measuring from the 3.3 step up OUT the measure was around 75 to 80mA, which i think is normal. i built a very small tracker with ESP12F (which i believe is suppose to have a better antenna than 12E), and 3.3v voltage regulator and two 250mah Lithium, the result is very small device with what i think is better tracking than nodeMCU, and its drawing 70 to 75mA . i have a small question, i think its silly but just wondering how do you track a room?, meaning are you leaving the device on a table for 10 mins (for example) or is it in your pocket while you walk around the room for a bit? i didnt see anything mention on best way to track. |
Good to hear you found the power issue. The ESP Network is "supposed" to ask for the same password the config requires. Nice to hear about your little tracker. How much battery life are you getting out of those two 250mAh cells? I am tracking by just tossing it onto a table and letting it sit there for a few minutes (I took like 20-30 "fingerprints" as reported by the UI which actually equals ~4x the amount in actual WiFi scans). Generally, that is sufficient but especially with rooms in close proximity (like two rooms that are below two other learned rooms that are side by side) it requires some alternations in the learning positions. I might add a "how to learn" button. |
thanks for the tip on how to track best. i deleted my previous tracking and learned them again by just keeping the tacker on the table or in my pocket, i think i'm getting better results now. i timed it twice and the little tracker is lasting around 6 to 6.5 hours, but i still have the blue led, and its blinking every 2 seconds so i think if i just break it, i will get maybe another hour. its fully charged (which is around 420mah) in one hour so its not bad for my use for now. another question and maybe a request, i'm just wondering how you are pulling location? for example just a script on a loop? |
At the moment the ESP8266 is sending a UDP multicast message to the group
In case you do not have access to UDP multicast networks it shouldn't be too difficult to add an HTTP callback. Just let me know whether or not the above suffices. I am in the process of building a small tracker based on a 2000mAh, the barebones 12-E, an LDO and an induction charging coil and will be testing with that. I'm hoping for a device that you can simply throw into your pocket and forget about. Unfortunately, batteries are always a big problem (literally) since the battery will be bigger than all PCB's added together (charging circuit, induction coil, voltage regulator and ESP) but I suppose it would be nice having ~24h "home"-time with a single charge. |
Sorry for the late response it's been a busy couple weeks. I don't have access to a UDP multicast networks, so it's not too much work for you, it would be great to add a http request call, I think it will help to reduce the pull rate for tracking location and easier I guess to implement in home automation. How's your setup going? I have a couple wireless chargers around and I was thinking of the same thing actually. |
I'll work on it the coming days. I got my 3000 mAh battery ready to go (was searching for a 2 Ah one but couldn't get one for a reasonable price and chose the marginally bigger 3 Ah one) including a charging board, voltage regulator and ESP. It all fits into a ~23mm tube that's about 9cm long. I might have bricked my ESP though since I cannot flash my sketch nor get any output from the bootloader 😢 . I checked the wiring against one of my development boards and there it seems to be working. I'm still hoping it has to do with the reset method not working as intended but I might be off ordering a bunch from china to experiment with. Just for reference, here are the parts I used:
The cylindrical battery imposes the need for a circular charging coil though. |
Thanks for the feedback, looking forward to the new version. |
I'm new to trying out FIND - just set it up this afternoon. However, I have a lot of ESP8266 based devices around the house and I'm wondering if anyone has approached using esp8266 based units for find-lf servers (for the track-all-the-things without an app approach) instead of using raspberry pi's? I have a ton of already-in-use sonoff and esp8266 devices doing random stuff that if they could also perform dual duty here would be great. I don't actually have any raspberry pi's around, and I haven't dug into this at all yet. Just trying to get a feel for if any work here has already been done. |
Aewsome job @TheMegaTB . |
Hi,
I've written an almost feature-complete program that you can upload to an ESP8266 to track it.
Just to take any doubts about the ESP actually being capable of tracking even though it has such a small antenna I can confirm that it works very well. I can track across the whole house in which room I'm currently in with almost no errors (might have to setup some more APs to get rid of the last bit of error) and around here are about 8-10 networks. Note that you'd have to re-learn every location for the ESP and cannot reuse the data from other devices like your phone (unfortunately) due to the difference in antenna size, geometry and gain.
You can configure every setting via a web UI from your smartphone or PC. It features tracking and learning as well as integration with my own smart-home project (basically it broadcasts it's position to a UDP multicast group). Have a look yourself:
If anybody is interested in the tracking code that's available in the TrackingData.cpp file. It sends new tracking data at a frequency of about 0.5-0.25 Hz and enters a deep sleep mode for 60 seconds if the preconfigured WiFi network is not available and tracking is enabled.
Instructions on how to install and use it are available over at the FINDTracker repository.
It might happen that I've missed something in the install procedure or just missed a nasty bug so please feel free to open issues or PRs.
@schollz maybe include it into the docs section for the ESP8266 if it meets your standards 😄
The text was updated successfully, but these errors were encountered: