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

Query IP of wifi module #288

Closed
wants to merge 685 commits into from
Closed

Query IP of wifi module #288

wants to merge 685 commits into from

Conversation

LnnrtS
Copy link
Collaborator

@LnnrtS LnnrtS commented Jul 2, 2024

This adds a separate logical channel in the serial interface to communicate with the wifi module itself (not with connected clients). For now the wifi module answers all messages on that channel with a 4 bytes indicating its ipv4 address (or 0.0.0.0 if not connected).

This information still needs to be made available to the UI

danngreen added 30 commits June 11, 2024 10:57
…iven the name filename

TODO: warning/confirmation about overwriting file
Fix making a new patch (stored in RamDisk volume)
Playing_patch also stored in open patch list
Notify user of error if file name exists in open files
@danngreen
Copy link
Member

Working on this now. It displays the IP or "not connected" if M4 reports none.

It would be nice to also somehow distinguish between "No wifi module" vs. "No wifi signal". Because if the UART connection to the Wifi module were to become disrupted, getCurrentIP() continues to report the last good IP it had.

Maybe we need a separate interface like bool WifiInterface::is_connected(). The interface would need to keep track of when M4 sent a request for the IP, and if didn't hear back in some timeout period, then the state is Disconnected. This could be a separate issue/PR, too, but the data would end up displaying on the same GUI page and we could use the same inter-core comm channel

@LnnrtS
Copy link
Collaborator Author

LnnrtS commented Jul 9, 2024

This now distinguishes between no response of the request and not connected to the network. After everything is up and running I can connect/disconnect the wifi module or turn off/on the access point and it shows the correct state in the gui.

The only thing that is missing is that the wifi module hangs on startup until it gets connected to a network. But this is will show as no module connected. So I need to make the connection attempt a separate async task.

Also the the gui could be refined (should probably show "no expanders" again when the wifi module gets disconnected)

@LnnrtS
Copy link
Collaborator Author

LnnrtS commented Jul 9, 2024

This will profit from #294

@danngreen
Copy link
Member

Cool. It works on firmware, but compilation fails for the simulator because std::expected is not supported:
https://github.com/4ms/metamodule/actions/runs/9861851753

We could upgrade the minimum version of clang/gcc required I suppose? Or roll our own std::expected

@LnnrtS
Copy link
Collaborator Author

LnnrtS commented Jul 10, 2024

The simulator build still needs to be set to c++23 (also with a recent compiler) but yes, ubuntu 22.04's gcc doesn't have that feature. I see that 24.04 is available in beta (but not yet set to latest). So just changing to ubuntu-24.04 in the github actions file should do that.

Since this project is still going to run for some time I would say it makes sense to make gcc12 (and CXX_STANDARD 23) a requirement going forward. Nore sure if how this would affect other developers at the moment though..

@danngreen
Copy link
Member

Clang 16 and Apple Clang 15 support std::expected. Our README states that clang 14 or later is required. It already requires gcc 12 or later, so that should be fine. But for anyone using clang 14, 15, or Apple Clang 14 would need to update.

I think is the direction to go, but I don't want to shock any other devs. Let me ask around...

@LnnrtS
Copy link
Collaborator Author

LnnrtS commented Jul 12, 2024

Ok. I have this prepared in #298

@LnnrtS
Copy link
Collaborator Author

LnnrtS commented Jul 18, 2024

The only thing that is missing is that the wifi module hangs on startup until it gets connected to a network. But this is will show as no module connected. So I need to make the connection attempt a separate async task.

This is working now

@LnnrtS LnnrtS marked this pull request as ready for review July 18, 2024 10:55
Update wifi patch list when patch storage changed
@LnnrtS LnnrtS mentioned this pull request Jul 22, 2024
@LnnrtS
Copy link
Collaborator Author

LnnrtS commented Jul 22, 2024

Closed in favor of #309

@LnnrtS LnnrtS closed this Jul 22, 2024
@danngreen danngreen deleted the wifi_query_ip branch July 24, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants