Raspberry-Pi Wifi Access-point

Hi there guys (@josephroberts , @majorz ),

I know that this is an old topic but right now WiFi Connect (rust version) got my attention for the past months and been trying to figure out how do I add a new feature to it.

Ideal scenario: The users connects to the WiFi Access Point (Captive Portal), after the user gets successfully connected to the Access Point and specified the desired WiFi & Password then a callback URL (as a redirect should be prompted / redirected).

Useful scenario: Using WiFi Connect within in one of my IoT projects and would like to pass along the device id of the IoT device to a mobile app using custom uri schemes (something like: customapp://device-id-123-321-123-321). So after configuring the IoT device from the mobile phone and have the app installed with the custom uri scheme then to open and pass my device id to the mobile application.

Been studying the diagram flow and would like to address a question how this might be possible and if you could help me with pointing / providing some code snippets would mean huge help!

I will highlight below where I would like to intervene with the URL callback:

My question(s) stands for:

Can I somehow add a RedirectMiddleware after the local wifi connection gets successfully connected to the internet and redirect to my custom URL ?

Can I extend the waiting time of the /connect in order that the stop captive portal does not gets called before getting the response from the /connect endpoint?

server.rs:157-160

   let mut chain = Chain::new(assets);
    chain.link(Write::<RequestSharedState>::both(request_state));
    chain.link_after(RedirectMiddleware);
    chain.link_around(cors_middleware);

Something like:

chain.link_after_internet_connection_succesfully(RedirectMiddleware);

Any input would be highly appreciate to find a viable solutions as soon as possible! :smile:

1 Like