The project I am working on has a raspberry pi running a web server. It needs its own Internet connection on a remote location and I need to connect to it over the Internet.
I’m looking into Electron for this. If my understanding is correct, I would need a global ip address to route packets to the RPi server. There is a mobile network provider known to assign a global ip to each user’s device. So I am thinking of buying an Electron without a data plan/SIM card and use the SIM that I get from the provider.
Would this be feasible? Since I live in Japan, I would greatly appreciate if anyone who has attempted something similar could share their experiences. Or is there a better way to achieve the same thing?
The Electron cannot be a server, even with a SIM card that allows it (the Particle SIM card does not). The Electron system firmware does not implement TCP listening sockets.
Not to mention a USB or ethernet connected 3g router/dongle would cost way less (1/4)…
Thanks. To be honest, I’m still trying to figure out what exactly Electron does, but my RPi runs a server. So Electron does not have to function as a server but I need it to route packets to my RPi server? Is this not possible with Electron?
The Electron is not a good choice here. It’s not designed to be a router, and it’s not able to listen for TCP connections.
Yep. I looked into several mobile/pocket routers but I’m yet to find a model that’s small enough for me. If you know of any that’s exceptionally small and affordable, and it has a port forwarding feature, please let me know because it will be easier just to use it.
Well you won’t find anything much smaller than a USB stick and plenty of those work - have a look on the Pi forums. You would probably also use a dynamic DNS service to make your device easily accessible.
An Electron is a microcontroller with a 3G Modem attached to make it an IoT device. The connectivity provided by the 3G module allows the user application running on the microcontroller to send/receive small packets of data/instructions (255 bytes) to the outside world via the Particle cloud over an encrypted link. It does this inherently securely with minimal overhead so uses very little data.
As an example you could be using a Raspberry Pi to control something fairly simple like a greenhouse or a beer brewing process and exposing the controls and sensor readings via a webpage, also hosted on the Pi itself. When you want to access those you load the entire page off the Pi to render in your remote device and that could be 100s of KBs. By contrast if you controlled that process with an Electron it could send just the data itself to a remote App or server as well as accept commands for just a few bytes. In addition there is no need to make sure any potential attack vectors are secured against remote access, or any of the other networking related things you might want to check on a full computer like a Pi, access control etc is all done for you.
Thank you so much for a very detailed answer. It might be starting to osmosis on me. It seems like Electron is not quite built for my purpose of compact mobile router. By Pi forums do you mean other forums here on particle.io or something on somewhere else?
Ah, this is the kind of thread I’ve been looking for. Thank you for helping me out.