-
Notifications
You must be signed in to change notification settings - Fork 712
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
wifi.cpp scan hangs after declaring object instance #158
Comments
I have tried to recreate and both scenarios worked for me. Here is the task that I ran... The usual suspects apply ...
|
Installed latest espidf. Trying to re-compile - error in cpp_utils...
|
Howdy @rweller59 About 2 days ago, that latest release of pre-3.0 ESP-IDF changed the data structures exposed by ESP-IDF that are used by BLE applications. This resulted in exactly the errors you encountered. Thankfully, a chap called @Philius caught the problem and quickly made code changes to the BLE C++ library. This was committed last night. My hope/belief is that if you re-download the BLE C++ classes from this repository, all should be back in synch again. How can we avoid these problems? Not easily I'm afraid. When ESP-IDF releases their 3.0 release, I'm also going to create a branch of the C++ classes that will always be guaranteed to work with 3.0. As ESP-IDF then moves on to their next release, there will then be two development streams in this repository. One which will be guaranteed to work with 3.0 and one that will keep in synch with the latest ESP-IDF. If you or anyone else have better / alternate notions, I'm very open to hearing those about how you would like this library maintained. Please let me know if a fresh download of the BLE C++ libraries found here resolves the issue. |
Just got back to this and updated. Compiled fine. I'm not overly concerned with this type of issue personally - I'm not trying to stay on the cutting edge of espidf releases unless there is a have-to-have. So, I'll keep trying stuff out and let you know when I find issues. Adding mqtt and I2C now so I'm sure you'll hear from me. fyi - I still have the original issue as stated above. I'll do more digging tomorrow and try to figure out how my code structure differs from your simple example and hopefully shed some light |
@rweller59 Thank you sir. I'm here to assist as best I can. I'm not going away from this project any time soon. |
so, here is what I have found. In the serviceWIFI class, I create WiFi wifi_debug and call wifi_debug.scan
|
In make menuconfig: |
I had not. Just tried it - clean, build. Didn't make a difference. Stopped at same spot |
@Philius Thats a new one on me. Do you know the semantics of that flag? @rweller59 Weekend is coming. I work 9-5 Mon/Fri but the weekends give me more time to work on ESP32. Please believe that your ticket is first up. I believe you have given me enough of a description that I can picture your code in my mind and will try and build a recreate from that. Just to be clear, I believe you are not using Arduino but are instead using plain ESP-IDF. |
That is correct. Eclipse c++ and ESPIDF. I appreciate you taking a look at it. I've got plenty of other things to work on in the mean time. |
I had to look it up just now myself :)
|
@nkolban, @rweller59 sorry I forgot to "at" you guys XP |
Can you give me some info I why I would need to do this (FreeRTOS->"Enable FreeRTOS static allocation API"?) in the first place for this situation? |
@rweller59 the WiFi class has a FreeRTOS::Semaphore data member m_gotIpEvt. |
@rweller59 Again I tried to recreate the issue and I again I couldn't ... it still worked for me. Here is the code I tried: Could you look over it and see if this is what you have? If not, consider performing a pastebin of what you have and I'll give that a try. |
Used your code in my existing project but I ended up with the same problem. Practically everything is commented out trying to get this to work but I'm assuming I've created a conflict somewhere. I am starting from scratch with a new project to see what happens. Finally got basic project settings correct and compiling but I've got to run to something else and will get back to this in a few hours. fyi - got this error when first compiling cpp_utils until I turned on c++ debug in menuconfig. things take forever to recompile - time for a new computer... |
@rweller59 To fix last error run: make menuconfig->Compiler options->Enable C++ exceptions. If you have had issues with compiling program from @nkolban, that one from pastebin, then you have had to change something in menuconfig. My advise is to remove sdkconfig and start again with make menuconfig. Ive got some issues with log outputs from bootwifi, few days ago got issues because of other log option. |
new project. hangs at exact same spot with this message in console the only changes from default I made with menuconfig were flash port, enable c++ exceptions, verbose |
@rweller59 Just copied, pasted and compiled your code. This is output:
Please try with this sdkconfig: You can change serial flasher options |
used that skdconfig - changed the name of com port through menuconfig. couldn't tell if it hung at the same point because debug messages are off. |
Now we have little progress. I see you are working on windows. What toolchain you are using? BTW, you can change logging to verbose in menuconfig if you want |
For the project I was working on originally, I followed the ESPIDF docs on setting up project for windows Eclipse. On this project I just created, I started with the steps on your youtube video 'programming in c++'. Had to make quite a few changes to get properties set so that I could compile. I can't find any options to define toolchain as xtensa-esp32-elf-gcc-5.2.0 -v Does your last comment mean start with the skdconfig in the link and start making changes until things work? |
Mast last comment mean check with this sdkconfig isntead that from last pastebin. If it works do whatever you need in menuconfig. |
version of sdkconfig didn't seem to make a difference. function is called then it hangs on serviceWiFi.wifiScan(); results of xtensa-esp32-elf-gcc-5.2.0 -v: |
Now i have big problem. Ive build MSYS environment on windows 10. Then what i did in steps:
Im using this MSYS version, or older one https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_toolchain-20170918.zip. It is configured with toolchain |
I know this isn't going to win friends ... but I'm going to suggest building under Linux. If we wanted to go that route, we have two choices:
or
My vote would be option 1. While I personally use Windows as my desktop, ALL my development is done in Ubuntu running on Virtual Box. I have found the tools fast and easy to use. While admitedly, I like to think I know Unix, the amount of Unix commands that need to be known are low. |
The only steps I can see that I did differently was potentially use a different version of msys. I don't remember how I installed it but I thought that I was working through the espidf docs. Also, if you aren't using eclipse that would be a difference as well. I am using Eclipse and trying to set up all of the environment so I could have messed up something there. Would it make sense if I tried without Eclipse? I haven't done that before so it might take me a bit to figure it out. Also, I could delete my version of msys and re-install? Sure sounds like its something in the linking/compiling process |
I've got a machine here with Ubuntu 16 installed. It's not very convenient to work on but if it solves some issues I can do that. I do not know linux at all so its a bit daunting - I always end up with permissions issues and have never really taken the time to try and figure it out. Do either of the steps in my last post sound like they've got a decent chance of potentially solving the issue? I feel like I'm running in circles and would love to take a positive step here. I just got some mqtt stuff compiling last night and thought I saw some similar issues on my first run there but shut down for the night and haven't gotten back to it. |
My suggestion is to prepare new environment. Its quick and easy. I dont see the reason why you cant work with eclipse. My first steps was on windows, and im still using this under linux sometimes, to write code with eclipse and then compile it from CLI with make flash. |
I work in Eclipse on Linux on Virtual Box on Windows 10. A whole slew of permutations. It might help if we spent a little time on Skype to show me the problem live? My skype id is "neil.kolban". |
What kind of resources do I need on the windows box to set up virtual? I've got i7CPU, 2.8gHz, 8GB ram, running 64 bit mode. If that's not good enough, I'll switch to the other machine. I'd love to skype if you think you might see something. Does, it make sense with the setup I've got or should I get the linux set up first? |
Your rig is enough to run vbox linux and work with comfort. I have laptop with intel i3 and 8GB ram. |
ok, I'll setup Virtual Box, Ubuntu, Eclipse and ESPIDF. Might take awhile and I don't know how much longer my wife is going to let me work tonight. I'll let you know when I've got things running |
My last 2 cents. Ive been trying ununtu 17, but it reqires more ram than ubuntu 14, so i personally prefer to work on linux ubuntu 14 |
Is 14 much different than 16? I've been using 16 for the past year or so and have a bit of experience |
Then stick with 16 |
still working through the linux install. I can config with menuconfig but I can't flash because I get a 'permission denied accessing /dev/ttyUSB0 error after compiling when its trying to upload. Haven't had any luck finding any solutions other than adding user to dialog group which is done. I'm doing this from the console and haven't starting working through eclipse yet. |
Only i can think of is dialog group, and you have to relogin when you add user to dialog group. |
I was thinking maybe I need to give permissions to python - trying to figure out to do that now |
There are two solutions to this problem .... one is immediate and the other is long term. When we add a serial port to Linux, it will show up as /dev/ttyUSB0. If we run "ls -l /dev/ttyUSB0" we will see the permissions on that file. On mine it shows up as:
The way to read this is that the user root has read and write permissions. Anyone who is a member of the group Two fixes
This fix will change the permissions to:
Which means that others have read and write permissions. However this change will be lost when you next attach the USB and would have to be repeated.
After that, logout (or reboot) and login again. Running the command:
should show that you are now part of the dialout group eg.
|
yep, got that far. this allows me to access with menuconfig. I can issue sudo chmod 777 and that allows me to flash but the permission goes away when session ends as you stated. I'm going to try and run the wifi example tonight and see if the issue has gone away then figure out eclipse setup and hopefully will be back up and running and moving forward. As long as I can issue a temp permission at least I can get work done. Have you looked at the members of dialout? Is there a python user or something similar listed? |
To confirm that you really got issues with python access permision you can download and start putty. But in situation when you didnt issue chmod 777 Also you can try esp8266/source-code-examples#26 |
The issue was that I logged out and logged back in thinking I would then load my groups. That didn't happen. I had to shut down Ubuntu then start again before it recognized that I was part of dialout group. |
got Eclipse up and running. compiled wifi example with class obj. doesn't hang so I guess I'm back in business. |
I really do believe you will be happier building in Linux in the long run. If nothing else, its the same environment that the majority of ESP32 users use so when problems are encountered in future, Windows as a platform can be ignored. |
I kind of like playing in linux, at least until something comes up that I can't figure out - like why std::string won't resolve. And yes, I did find your discussion regarding the issue (https://www.esp32.com/viewtopic.php?f=13&t=1284) although none of the suggestions seemed to fix it it on my machine... seems kind of funny that other libraries seem to be found. At least I can compile at this point |
If desired, I can offer some of my time via a Skype session to have a look at individual issues. I am in US Central Time and available after 6:00pm (usually 10:00pm till Midnight) and at weekends. |
well, it helps to type xtensa rather than extensa. makes a big difference - that's what I get for looking at instructions in windows and setup in virtual. can't cut and paste. |
Can we call this issue closed? If so, go ahead and close it out. You can open new issues for new puzzles. |
solution: error went away after moving from windows/eclipse to ubuntu/eclipse |
Could you please explain the following
This scenario DOES NOT work for me:
This scenario DOES work for me:
The text was updated successfully, but these errors were encountered: