|
Forum Index : Microcontroller and PC projects : Wifi webmite and Pi Pico Plus 2W
| Author | Message | ||||
| xardomain Newbie Joined: 28/06/2026 Location: ItalyPosts: 10 |
Hi, I got the boards now (six!), time to try to make them work together. I would like to know: 1) How to differentiate between MCUs, like acquiring the MAC address. The same program will be flashed on 6 pico, but only one will be the controller so I detect its specific MAC and behave differently from the others. The others are all equal with the same connections but the controller will have to be always the same, it is wired differently. Apparently I can't detect the current MAC address from Webmite. 2) I see that on boot there is an ID displayed(PICO5FF0ED8XXXX), same as before. How to get access to it(supposed it is unique of course)? 3) Netmask and broadcast address I would like to dynamically acquire these parameter in the program, I don't know how. Searched for it, I was unable to do it. 4) Manual wifi configuration: I am okay with the DHCP but I need to somewhat "order" the nodes, and assign a different parameter (a different delay offset) to each one. Again with the MAC address I could sort them in ascending order, or something similar. The IP address could be used too but probably with the MAC address is easier. Still, would it be possible to "force" a specific IP address? 5) After powering on, the wifi connection fails: > 17:00:12 Port: COM6 removed Disconnected 17:00:16 Port: COM6 inserted Connected to COM6 at 115200 PICO5FF0ED861FD connecting to WiFi... failed to connect. Initializing... If I press the RESET subsequently it always connect. Is there any way to correct this behavior? My fix was trying to reset with the command CPU RESTART until I don't get an IP: IF IP$ = "0.0.0.0" then 'WATCHDOG 1000 ' arm a 1-second watchdog 'DO : LOOP ' do nothing — let it expire and force a restart PRINT "Wifi initialized failed. Retrying..." PAUSE 500 cpu restart endif I was hoping to avoid the double boot process. Thanks. Giuseppe Marullo IW2JWW - JN45RQ |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3316 |
> ? MM.INFO(ID) D531A797204 > It's a string so this may be better. > s$ = MM.INFO$(ID) : ? s$ Or as an integer.D531A797204 > > execute "x% = &H"+MM.INFO$(ID) > ? x% 14650577613316 > My startup routine. Sub MM.STARTUP Pause 500 'ensure connection routine is finished On error skip If MM.Info(ip address) = "0.0.0.0" Then 'test for WiFi link Print "WiFi not found"; Pause 8000 'if router is slow give it time before next attempt Print "...Rebooting now" CPU restart 'endless re-boot until WiFi found EndIf Local float TZ = 10, DS = 0 'Time Zone, Daylight Saving Local integer n = 0 Do While Date$ = "01-01-2024" 'test internet connection, wait for date$ to update On error skip WEB NTP TZ+DS, "203.12.160.2" 'Second choice is 0.au.pool.ntp.org or 1.au.pool.ntp.org Inc n : Print n; " tries", DateTime$(now), Pause 2000 If n=15 Then Exit Sub 'give up! Loop RUN 'start main program End Sub Edited 2026-07-09 15:23 by phil99 |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4343 |
Instead of execute "x% = &H"+MM.INFO$(ID) maybe x% = val("&H"+MM.INFO$(ID)) John |
||||
| xardomain Newbie Joined: 28/06/2026 Location: ItalyPosts: 10 |
Thank you Phil99 and John. Nice improvement for retrieving NTP time. At the moment I am planning to use the ID instead of the MAC, then I will decide if it is enough. Still I am don't know why wifi fails at first power on, it is sistematic. Is it a known bug? I am using a Pico Plus 2W, RP2350A04. Giuseppe Marullo IW2JWW - JN45RQ |
||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6542 |
What make of router are you connecting to? There were problems with some FritzBox models but I thought that was now fixed with later Fritz firmware. Jim VK7JH MMedit |
||||
| xardomain Newbie Joined: 28/06/2026 Location: ItalyPosts: 10 |
Hi TassyJim, router is a UniFi Cloud Gateway Fiber UCG-Fiber. Giuseppe Marullo IW2JWW - JN45RQ |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |