WiFi static IP address problem and how to find IP address of PICO on Android application #1818
Unanswered
freeday-2023
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I connected Android phone (application made in B4A programming language) and Raspberry Pi PICO microcontroller (programmed via Arduino IDE environment) over the WiFi network.
The connection is established via UDP protocol and it works ok, messages are sent form Android to PICO.
PICO takes commands and does some things… Android phone is like remote control for PICO.
IP number settings can be done manually, and finding IP addresses is done using the IP scanner programs, and similar juggling...
But the problem is the initiation of the connection without user intervention:
If the PICO is in "Client on WiFi network" MODE, it receives an IP address when starting, but from the Android application I do not know which adress it is.
The problem in this mode is how to set PICO to find and connect to the network I want, if the device is without input and output accessories (it has no screen or keyboard).
If the PICO is in Access Point MODE (creates its own network at startup), I can connect to it with an Android application, but then again I don't know what is PICOs IP address!
For some reason I can't set the PICO to be at static IP address in any MODE???
The third MODE is to create an Access Point on the Android phone with a known network name and password and program it in PICO to automatically connect to that network.
I tried it and PICO connects and reconnects to than network but gets some unknown IP address again, so it's impossible to connect from the Android app! The address of the PICO controller can be found on Android in the info of connected devices to this Access Point, but that again implies manual data transfer to the Android application!
If possible, what is the easiest way to connect these two devices (Android phone and Raspberry PI PICO) over WiFi network in one of these MODES without user intervention?
It would be great if they could be given some names and find themselves on network automatically???
I have done a search for similar discussions, but I didn't find much...
B4A programming language is great, but I've had no luck with the examples. I'm still looking...
There is an example on GitHub (KLIMERKO - pollution measuring device) where an ESP-32 microcontroller is used that makes an Access Point and when Android connects to it, it gets automatically web page where user can change the parameters of the local WiFi network, and after a reboot the ESP-32 connects to that network...
But I was not able to apply that example to PICO!!!
Can anyone help?
Beta Was this translation helpful? Give feedback.
All reactions