6

Yeah - mostly some mad scientist stuff here.

I have an IoT project I'm working on where each device must be independently connected to each users phone and not connected to any central WiFi network. So please keep in mind that this IoT board does NOT have any internet connection in and of itself.

To solve this, I've found a few hacks where (if I set the DHCP to Static, the DNS and router to blank) that (at least for iOS) allow me to connect to the device over WiFi, and send and receive data to the board over this protocol, while remaining connected to a 4G/LTE signal

So far so good.

I've installed NGINX and am running a web server that hosts a captive web portal/web app to control functions and send commands, as well as receive the resulting data. Again, so far so good. At this point, I'm able to connect to the board over WiFi, have a captive portal appear, send and receive content.

However here's where it gets sticky. As the client smartphone is connected to the device over WiFi and to the wider internet over 4G - the goal is to allow these simultaneous connections to allow both local content on the IOT board (fed locally over Wi-Fi) and external content hosted on remote servers (fed over 4G) to be rendered on a single DOM.

Basically what I'm trying to do is this: a single web app hosting content from two different types of connections

I'm planning a few ways to tackle this problem in the upcoming week - and the most promising I can think of is to use an NGINX reverse proxy to host content on the captive portal from two locations.

Question 1.) Does anyone feel that I'm on the right path to solving this problem through setting all the resources to relative:

site.html
site.jpg
site.css

have proxy rules that do:

site.html served from local webserver on embedded board
site.jpg proxied to external.jpg on external webserver
site.css proxied to external.css on external webserver

However my understanding of reverse proxies is that the embedded board needs to have its own internet connection in order to do this?

Question 2.) Are there any other ideas that anyone can think of to solve this - even crazy ideas like XSS vectors to PUSH content into the captive portal from external servers?

Question 3.) My hack of setting DHCP to Static and DNS and Router to Blank only allows for simultaneous Wi-Fi & 4G connections on iOS... not Android. Any ideas of how to do this on Android too? Wi-Fi Direct maybe?

4
  • 2
    Welcome to the site, generally it's better to ask one distinct question rather than several questions. However, I think you have made your problem clear enough that people can go on those information.
    – Helmar
    Commented Jun 18, 2017 at 16:22
  • 1
    Ah very good feedback. I feel that Question 1 and 2 were pretty inclusive to each other. Only reason I asked about Question 3 was that it was relevant to the situation as many people are unaware that IOT devices can be accessed over WiFI without losing 4G/LTE on an iPhone. Without this dual connection - WiFi and 4G simultaneously- the entire concept is impossible. Normally I'll certainly split up my posts into individual questions, however! Commented Jun 18, 2017 at 16:37
  • I have this exact problem, did you develop a nice solution? Commented Jul 11, 2023 at 12:18
  • Or even a bad one :D Commented Jul 11, 2023 at 12:18

1 Answer 1

6

Question 2.) Are there any other ideas that anyone can think of to solve this - even crazy ideas like XSS vectors to PUSH content into the captive portal from external servers?

If I may suggest, you consider using the AllJoyn framework?

  • runs on the local network.
  • enables devices and apps to advertise and discover each other

Looking at your problem statement, you may leverage AllJoyn in following manner:

                     AllJoyn Net
<------------------------------------------------------>

 +-------------------+   WiFi   +-------------------+     4G       +-------------------+
 |                   |          |                   |              |                   |
 |    iMX6 Board     |          |        Phone      |              |       Server      |
 |                   |          |                   |              |                   |
 |  +-------------+  |          |  +-------------+  |              |                   |
 |  |             |  |          |  |     APP     |  |<<--- GET-----|                   |
 |  |     APP     |  |          |  |             |  |      JPG     |                   |
 |  |             |  |          |  +-------------+  |              |                   |
 |  |             |  |          |                   |              |                   |
 |  +-------------+  |          |  +-------------+  |              |                   |
 |                   |          |  |    Router   |  |<<--- GET-----|                   |
 |                   |          |  +-------------+  |      CSS     |                   |
 +-------------------+          +-------------------+              +-------------------+
4
  • 1
    This looks AWESOME! Totally new concept - I'll read up on this and test it this week. I'll post back on here with the feedback Commented Jun 18, 2017 at 16:50
  • 1
    From your understanding would the the AllJoyn framework require native apps, or would it work with web apps/captive portals? Commented Jun 18, 2017 at 16:54
  • 1
    @ThatsNoMoon, this will help you allseenalliance.org/framework/documentation/supported-platforms. Lists language bindings and supported platforms
    – sob
    Commented Jun 18, 2017 at 16:57
  • 2
    This will of course require a native app - a browser won't touch something like this, as it grossly violates the whole point of the same origin policy. Commented Jun 19, 2017 at 4:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.