Setup 4G USB modem on RpiB+ connect to router

Hi Nigel, I have an E3372 but I can’t get it to power up :frowning:

Going from memory (which can be risky!) if you can get to the home page of the device there is a tab for Advance… in there you should find ipsettings, probably set to Dynamic (read DHCP) , same for DNS. I can’t recall if you get a drop down list to set IP to static/fixed/manual or if you just type in the ip address you want.

But, that is an older device so support is very limited (manuals and good instructions aren’t easy to find plus Telstra/Optus have very specific settings and limited access to settings. The newer WiFi wingles like Huawei E8372(h-608) or ZTE MF823 would be a better device to use I reckon - with a lot more configuration flexibility.

Great that you keep posting back with updates - any helpers appreciate that!

Hi Nigel, if you change the DHCP range in Rpi Master dnsmasq make sure it does NOT include the 4G dongle IP. For example - if the dongle IP is 192.168.8.0, then make the Rpi Master dnsmasq DHCP range 192.168.8.10 ~ 192.168.8, 254. Also, ensure that the 4G dongle and the Rpi Master are on the same subnet - 255.255.255.0 for example…

Well, I tried a bunch of things yesterday, all to no effect.

I tried matching the Rpi Master’s dnsmasq DCHP issuing range to that of the 4G dongle.

I followed a few bridging tutorials, aimed specifically at sharing Intenet connections (albeit wirelessly sharing an ethernet sourced connection ie. the Pi as an access point)

I tried to get my head around Forwarding but I don’t feel comfortable with iptables. I don’t like that there’s no config file to open and study and, without any success in a live session, I wasn’t game to write a file to invoke any permanent changes.

I think I will have to proceed with straight ethernet as my conection to this system, at least until I solve this in a test rig at home. It’s a bit of a pain, having to drive with a laptop to the site to access the images and in the meantime I will have no monitoring to know whether the rig is working.
Definitely not ideal.

I wish there were a Rpi consultancy online, where I could simply pay to get this solved.

If you know of any, please advise.

I posted on Upwork but got no takers.
My last Upwork job posting failed miserably, the applicant seemed very keen and experienced but in the end didn’t deliver a working solution ~ which was an Ardunio scheduling sketch, intended to manage the remote power of the cameras and the Rpi.
Cheers
Nigel

Hi Nigel, You might be overthinking the issue. What you are trying to do is basically what every household internet connection does - a WAN service comes in and connects to a router, which then manages the local devices over LAN/WLAN. - like so:
image

As per the notes on the drawing, for simple Internet connectivity a fixed IP at the Rpi Master, connected to the router WAN port then using the Local Router to do LAN assignment, NAT and IP forwarding is the common way.

One solution might be to plug the 4G USB modem directly into the Local Router if that is possible (I’d have to read up on the router to be sure though) then connect the Master and Slaves to the router LAN ports so they can all talk on the same network and just use the USB internet connection on an ad-hoc basis as required.

I can try to help you out, I am Brisbane and working on a few projects of my own, but I will do what I can. From experience it is pretty usual to get boxed in by an issue - which is where forums excel! Different approaches and lateral thinking!. I don’t have a Rpi though, but I am not sure that is necessary (other than to change IP settings to make it a WAN connection to the router). it depends what else the Master is doing.

My direct gmail is stevo7452@gmail.com if I am allowed to pass this info to you here?

UPDATE:

  1. The Netgear DG2200v4 doesn’t accept USB modems - so not an option
  2. The DG2200v4 does have a specific WAN port, with configuration options that should work for you
  3. The DG2200v4 can do NAT translation and IP forwarding
  4. Today, my E3372 is alive! so later this morning I will look at that and see what setting can be reached.

Hi Steve,

Thanks mate, however your schematic excluded my recent following of your suggestion to remove the doubling up of Routers.

here’s what I’ve been working with the last 24 hours or so… using a dumb hub instead of the router

However I’ve realized since that, considering I have to go onsite physically to switch on the Rpi Master and slaves, to access their image contents, I might as well use the built in WIFI of the Rpi Master, instead of wasting mobile data in the process.

So I’ve now reconfigured to remove the USB dongle and switch on the WIFI on the master.

So my current IP set up - to match the wifi router settings in my office is:

static IPs - set in /etc/dhcpcd.conf

wifi
WLAN0 192.168.0.10
ethernet
ETH0 192.168.0.11

So, with the Master Rpi switched on and it’s wifi connected to either my office router, or my mobile phone hotspot I can see the internet, which means I can in turn access it, either via ssh, using my remote access service Remot3.it, or Teamviewer, which gives me a gui desktop.

So it’s the same functionality as the USB modem, but costs nothing, other than the data on my phone.

Unfortunately the slaves can’t see the internet in this set up so I can’t do any upgrades or installs but hey. it works!

Cheers
Nigel

Hi Nigel, thanks for the update. Having fired up my E3372 I have realised why it is no longer in service for me - very limited control! So I think if the USB 4G modem (to get internet service) is needed, try a different modem… :slight_smile:

My drawing was just to show what you were hoping to achieve… as a starting point and to show the normal sort of setup - Internet to modem to Master to router.

So the Rpi Master is setup to do the routing? so there might be a capability in there for NAT and IP forwarding. What else does the Rpi do?

Depending on your ultimate goal then if Internet connectivity is wanted for every device, there are a few options to consider to deliver what you want. As the devices are connected now, you can share in between them all - which would also work if you used the same arrangement with a router in place of the switch. Any external internet service could be connected via the WAN port on the router and the configuration/NAT/IP forwarding also done at the router. (this might reduce the complexity/PoF’s…)

Is there any reason why you are allocating so many IP addresses in the range - you only have a few connected devices?

Steve W

Hi again,

Your drawing was awesome!

I seem to be having exactly the same issue with the wifi not being shared beyond the master Rpi, as I was with the 4G setup.

I feel sure the Rpi can be configured to do routing but the iptables configuration differs from other configs I’ve done. There’s no .config file to look at and tweak. One issues commands and they’re good for that session but if you want persistent changes, you have to create your own settings file and get it loaded on startup. I’ve tried a few tutorials to set up the iptable commands but not got it working.

Networking is simply too confusing… aside from IP addresses there’s the netmask that I don’t understand and forwarding. apart from simple router port forwarding is a mystery to me.

I’m now simply trying to achieve, wifi connectivity at the location but struggling a bit with that too. I can see the RpiMaster, if I enable mobile data on my phone as well as the hotspot, because both Teamviewer and Remot3.it are clever and can reverse ssh into anything but I really don’t want to be transferring GIGs of images over the data connection, when I’m right there onsite with wifi connection too.

I’m currently adding a 32 GIG SD card into the Master Rpi with a view to copying the images onto it, and then sneaker netting the USB into my laptop to get them into my grasp.

I’m running out of patience a bit because I now am struggling to get the SD card permissions opened up.

Tearing hair out!

N

PS. I was only allocating so many IP addresses because they’re free. Didn’t seem to matter really.

Hi Nigel, With what you are trying to achieve, I think you need to have a basic understanding of networking - IP ranges and sub-nets at least, to help with the issues you are having.

Maybe this will help - https://www.techopedia.com/6/28587/internet/8-steps-to-understanding-ip-subnetting

With IP ranges, my own approach is to limit addresses to the expected maximum user count and if possible use static/fixed ip’s (usually tied to device MAC addresses). Not such an issue with wired connection but with WiFi and especially remote devices, you are providing doors into your network for a determined hacked to find. It depends if what you are working on has any privacy implications I guess, but as I said earlier, I’m old school.

Reading between the lines, I can’t help but think that you seem to be ‘re-inventing the wheel’ and are overlooking off the shelf solutions that have had years of development (i.e. quality routers) that are capable of fixing the problem. Just need some lateral thinking to work out what is best to do what you want with the minimum device count. Trust me, I have developed enough solutions over the last 45 years to understand just how easy it is to get tunnel vision and concentrate on resolving a problem that actually isn’t really there or is easily solved by buying the right bit of kit. I don’t want to discourage you at all, far from it but seem to be having basic issues. One project I am working on currently seems similar to yours - a central comm’s (Wifi, LTE, BTLE, SigFox & LoRA) ‘server’ with many remote, scattered devices providing data. The server uses multiple SD cards, which has taken a bit of effort to resolve, but is now working - the core products are not Rpi though. There are also OTA updates and management, local manual upgrades and data collection, Web Server and FTP components to cover all the client requirements.

I am happy to continue helping you as best I can but would prefer to do that outside this forum because the discussion will get quite technical and possibly move away from the ‘maker’ environment.

Regards
Steve W

Hi Steve,

Thanks again for your continued encouragement and the link to networking information. I’ll check it out.

I feel sure that once I understand the various parts of the puzzle ~ subnets / netmasks / ip forwarding / dns routing etc., that the Rpi will be more than capable of meeting those requirements.

It all seemed so simple at the outset, to share a working Internet connection, whether sourced from wifi or 4G, with a few other machines using the ethernet port and a hub. I’m actually surprised that my configuration doesn’t have an existing and up to date example on the Net.

If I’d gone for a wireless network there were plenty of examples of a Raspberry Pi based wifi access point, however I can’t be sure all my cameras in a given location will be close enough together for reliable wifi connectivity. Some construction sites require cameras 30-50 meters apart and often the subject building will come up in the middle and potentially block the signals.

As for security, it’s totally a non-issue for me. I’m not handling any sensitive data. My rigs take time lapse images of practically no interest to anyone but me and my client (a local builder), and, even when I manage to schedule the power correctly, the Rpi’s will only be active for a few minutes each hour, during work days. Not a very accessible or tempting target for wardriving hackers, not that we have any of those here in Byron Bay.

Right now, I am happy that I can achieve my immediate needs, so I’ll deploy this rig and make do with weekly trips to retrieve the images and, in the meantime I’ll read up on networking and do some trials on a test rig at home until it’s all working, then I can replace the guts of the time lapse rig. Fortunately it’s built so I can easily swap out the control board, from the metal box half way up the 4 meter pole it’s mounted on.

I hesitate to tug on your sleeve any further but thank you for all your time and thought

Cheers

Nigel

Nigel Haslam | Director


Motion Circus Pty Ltd. Byron Bay

t : + 61 2 8007 7338 | m : + 61 403 020 126
w: www.motioncircus.com

link to website

On Sat, Dec 15, 2018 at 8:11 AM Steve70565 <core_electronics@discoursemail.com> wrote:

![\ 45x45](upload://wJSVRlrrSh7Q25V5LPfdyXKdqF4.png Steve70565
December 14

Hi Nigel, With what you are trying to achieve, I think you need to have a basic understanding of network - IP ranges and sub-nets at least. That seems to bee to root cause of the issues you are having.

Maybe this will help - https://www.techopedia.com/6/28587/internet/8-steps-to-understanding-ip-subnetting

With IP ranges, my own approach is to limit addresses to the expected maximum user count and if possible use static/fixed ip’s (usually tied to device MAC addresses). Not such an issue with wired connection but with WiFi and especially remote devices, you are providing doors into your network for a determined hacked to find. It depends if what you are working on has any privacy implications I guess, but as I said earlier, I’m old school.

Reading between the lines, I can’t help but think that you seem to be ‘re-inventing the wheel’ and are overlooking off the shelf solutions that have had years of development (i.e. quality routers) that are capable of fixing the problem. Just need some lateral thinking to work out what is best to do what you want with the minimum device count. Trust me, I have developed enough solutions over the last 45 years to understand just how easy it is to get tunnel vision and concentrate on resolving a problem that actually isn’t really there or is easily solved by buying the right bit of kit. I don’t want to discourage you at all, far from it but seem to be having basic issues. One project I am working on currently seems similar to yours - a central comm’s (Wifi, LTE, BTLE, SigFox & LoRA) ‘server’ with many remote, scattered devices providing data. The server uses multiple SD cards, which has taken a bit of effort to resolve, but is now working - the core products are not Rpi though. There are also OTA updates and management, local manual upgrades and data collection, Web Server and FTP components to cover all the client requirements.

I am happy to continue helping you as best I can but would prefer to do that outside this forum because the discussion will get quite technical and possibly move away from the ‘maker’ environment.

Regards
Steve W

Visit Topic or reply to this email to respond.

In Reply To

![\ 45x45](upload://yyKuCppFeQy2g2xrcHWhu0391h0.png Nigel49220
December 14

Hi again, Your drawing was awesome! I seem to be having exactly the same issue with the wifi not being shared beyond the master Rpi, as I was with the 4G setup. I feel sure the Rpi can be configured to do routing but the iptables configuration differs from other configs I’ve done. There’s no .co…

Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.