Skip to content
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

wifinina: can't connect to AP 50% of the time #468

Closed
scottfeldman opened this issue Oct 5, 2022 · 5 comments
Closed

wifinina: can't connect to AP 50% of the time #468

scottfeldman opened this issue Oct 5, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@scottfeldman
Copy link
Contributor

I'm using drivers/examples/wifinina/tcpclient/main.go example on Arduino Nano33 IoT.

I'm seeing AP connect fail 50% of the time. In fact, it seems to toggle between pass and fail. Usually, after tinygo flash, the AP connect will fail. Pressing the hard reset button on the Nano33 will try the AP connect again. This time it will connect. Pressing the hard reset again, the AP connect will fail. And so on...

I logged the connection status during the AP connect to see what's going on:

[tinygo flash]                                                                                                                                        
                                                                                                                                                    
Connecting to [my ssid]                                                                                                                                 
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS Connect Failed                         <-- failed                                                                                                      
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
...                                                                                                                                                 
                                                                                                                                                    
[HARD RESET]                                                                                                                                        
                                                                                                                                                    
Connecting to [my ssid]                                                                                                                                 
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS Connected                            <-- success                                                                                                        
Connected.                                                                                                                                          
192.168.1.152                                                                                                                                       
---------------                                                                                                                                     
Dialing TCP connection                                                                                                                              
...                                                                                                                                                 
                                                                                                                                                    
[HARD RESET]                                                                                                                                        
                                                                                                                                                    
Connecting to [my ssid]                                                                                                                                 
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS No SSID Available                                                                                                                            
STATUS Connect Failed                     <-- failed                                                                                                          
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed                                                                                                                               
STATUS Connect Failed
STATUS Connect Failed
STATUS Connect Failed
STATUS Connect Failed
STATUS Connect Failed
STATUS Connect Failed
...

[HARD RESET]

Connecting to [my ssid]
STATUS No SSID Available
STATUS No SSID Available
STATUS No SSID Available
STATUS No SSID Available
STATUS No SSID Available
STATUS No SSID Available
STATUS No SSID Available
STATUS No SSID Available
STATUS No SSID Available
STATUS No SSID Available
STATUS No SSID Available
STATUS Connected                    <-- success
Connected.
192.168.1.152 
---------------
Dialing TCP connection 
...

I tried various delays after holding RESET low and high. No change.

I tried RESET twice (low/high/low/high). No change.

@scottfeldman
Copy link
Contributor Author

I tried the same wifinina/tcpclient example on Arduino Nano RP2040 and get the same results. Connection attempts fails 50% of the time.

(wioterminal using rtl8720dn/tcpclient example connects 100% of the time, connecting the same AP as the Arduino Nano tests).

@scottfeldman
Copy link
Contributor Author

I tried using a different Wifi router, and the issue goes away. The issue was first reported on a Starlink Wifi router, so maybe this is limited to connecting to Starlink router.

@scottfeldman
Copy link
Contributor Author

Just a note for now: this issue is fixed with the netdev branch.

@deadprogram
Copy link
Member

Also fixed by #561 until that gets merged in TinyGo 0.29 release.

@deadprogram deadprogram added bug Something isn't working next-release Will be in next release labels May 14, 2023
@deadprogram
Copy link
Member

This was already released so now closing. Thanks!

@deadprogram deadprogram removed the next-release Will be in next release label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants