mushu999
Posts: 29
Joined: Sun Aug 20, 2017 11:24 pm

Assign diff IP to eth0 than wlan0 on 3B+ ?

Wed Nov 07, 2018 11:36 pm

I've confused myself into a corner. Trying to hook up a security cam in the garage to a Pi 3B+ running MotionEye application (not O/S) on Stretch. The cam has a built-in wireless access point (AP) and an Ethernet connection for wired access. Simplistically, that tells me that it wants to be "the server" for wireless connections or "the client" for wired ones. I know the cam works because I hooked it directly into my home router via wired when I opened it and it got assigned a 192.168.x.x IP via DHCP and I was able to view the image through a browser, but now it is mounted on the side of the house and I have this conundrum. My Pi is currently in the garage as well and connected to the home network via wireless and has a valid 192.168.x.x IP address. So the $10M question: how do I get the Pi to "see" the cam via the Ethernet connection?

My first thought was to simply use a CAT 5 and hook them together. But...nothing. So then I grabbed a cheap little switch and connected the Ethernet ports together that way. Nothing. Now I'm thinking I need an ethernet-to-ethernet Bridge. If I ran 80 feet of CAT 5 from the living room into the garage directly to the cam it would work just fine but I really really don't want to do that. There *must* be a way to make this work. Thoughts anyone? Getting desperate. :-(

bmattila55
Posts: 59
Joined: Wed Jun 06, 2018 12:54 am

Re: Assign diff IP to eth0 than wlan0 on 3B+ ?

Thu Nov 08, 2018 12:21 am

mushu999 wrote:
Wed Nov 07, 2018 11:36 pm
I've confused myself into a corner. Trying to hook up a security cam in the garage to a Pi 3B+ running MotionEye application (not O/S) on Stretch. The cam has a built-in wireless access point (AP) and an Ethernet connection for wired access. Simplistically, that tells me that it wants to be "the server" for wireless connections or "the client" for wired ones. I know the cam works because I hooked it directly into my home router via wired when I opened it and it got assigned a 192.168.x.x IP via DHCP and I was able to view the image through a browser, but now it is mounted on the side of the house and I have this conundrum. My Pi is currently in the garage as well and connected to the home network via wireless and has a valid 192.168.x.x IP address. So the $10M question: how do I get the Pi to "see" the cam via the Ethernet connection?

My first thought was to simply use a CAT 5 and hook them together. But...nothing. So then I grabbed a cheap little switch and connected the Ethernet ports together that way. Nothing. Now I'm thinking I need an ethernet-to-ethernet Bridge. If I ran 80 feet of CAT 5 from the living room into the garage directly to the cam it would work just fine but I really really don't want to do that. There *must* be a way to make this work. Thoughts anyone? Getting desperate. :-(
Hi,

I am a bit unsure about this one. It may help if you also contact the support for the security camera. While they may not be able to give you much help on the Pi side of things they may give you a helpful insight in how to camera can be connected to external devices.

Just a thought, Ben

mushu999
Posts: 29
Joined: Sun Aug 20, 2017 11:24 pm

Re: Assign diff IP to eth0 than wlan0 on 3B+ ?

Thu Nov 08, 2018 12:29 am

Appreciate that. I did do that via email, and the support person wrote--through broken Chienglish--explained that the software they have is for Android and iPhone and Windows only and couldn't give me any technical details about the camera other than the RTSP port it uses. So, there's that... /sigh

mushu999
Posts: 29
Joined: Sun Aug 20, 2017 11:24 pm

Re: Assign diff IP to eth0 than wlan0 on 3B+ ?

Thu Nov 08, 2018 12:33 am

Since the direct wired Ethernet connector option works, I'm wondering if there is a way on the Pi to use DHCP/IPtables and configure the eth0 port as a router that can issue the cam an Ip address, yet leave the wifi on wlan0 alone so it can still connect to my home network. Basically turning the Pi into a multi-homed bridge...but I'm not sure how to approach trying that, not too knowledgeable in configuring IPtables...

PhatFil
Posts: 1437
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Assign diff IP to eth0 than wlan0 on 3B+ ?

Thu Nov 08, 2018 3:32 am

without a make/model number of your camera its tricky to advise, but in my limited experience with a few home wifi gadgets, when a device starts up offering an AP it can often be a setup portal for configuring your networks wifi credentials and sometimes even allow the setting of a static ip. A common address used for a config-AP is 192.168.4.1.

So i would start by using a wifi enabled puter to connect to the cameras AP and point a browser @ 192.168.4.1 or the gateway addy you retrieve from an ipconfig/ifconfig command at the command prompt.

bmattila55
Posts: 59
Joined: Wed Jun 06, 2018 12:54 am

Re: Assign diff IP to eth0 than wlan0 on 3B+ ?

Thu Nov 08, 2018 3:36 am

PhatFil wrote:
Thu Nov 08, 2018 3:32 am
without a make/model number of your camera its tricky to advise, but in my limited experience with a few home wifi gadgets, when a device starts up offering an AP it can often be a setup portal for configuring your networks wifi credentials and sometimes even allow the setting of a static ip. A common address used for a config-AP is 192.168.4.1.

So i would start by using a wifi enabled puter to connect to the cameras AP and point a browser @ 192.168.4.1 or the gateway addy you retrieve from an ipconfig/ifconfig command at the command prompt.
Good idea.

epoch1970
Posts: 3875
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Assign diff IP to eth0 than wlan0 on 3B+ ?

Thu Nov 08, 2018 9:35 am

mushu999 wrote:
Wed Nov 07, 2018 11:36 pm
My first thought was to simply use a CAT 5 and hook them together. But...nothing. So then I grabbed a cheap little switch and connected the Ethernet ports together that way. Nothing. Now I'm thinking I need an ethernet-to-ethernet Bridge. If I ran 80 feet of CAT 5 from the living room into the garage directly to the cam it would work just fine.
That's because the router in the living room runs a DHCP server.
- Connect the Pi to the cam with a cable (no need for a switch, but useful if you want to plugin a laptop and do maintenance on that island network or if you want to interconnect with the main network),
- Choose a network to host the cams, different from your main network. Say network 172.16.16.0/24
- Give the Pi a static IP address on eth0, say 172.16.16.1
- Configure the dnsmasq package to serve IP addresses from a pool, say 172.16.16.10-172.16.16.254
- Start the Pi, reboot the cam and it will get an IP address. If you look in /var/log/syslog on the Pi you'll see which one. Or in /var/lib/misc/leases (? something-leases)

With this the cam only "sees" the Pi and conversely. It is an isolated network.
Using the Cam as AP and the Pi 3 as wifi client would come to the exact same result.
Access security, service availability are probably better with ethernet.

If in addition you start wifi on the Pi to your main network, or add to it an extra ethernet device and cable, you can have the Pi connect to both networks, and be a router (aka network gateway). From the main network you could then access the cam. Doing this requires a little bit of extra configuration.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

mushu999
Posts: 29
Joined: Sun Aug 20, 2017 11:24 pm

Re: Assign diff IP to eth0 than wlan0 on 3B+ ?

Thu Nov 08, 2018 12:42 pm

Thanks, that's helpful. I guess I was dancing around the fact that i just need to turn the Pi into a router to make this whole thing work the way I want. The cam is no longer on their website but it is a "T-series" from https://jennov.com/ and a search on their website turns up a software download and a manual. Here is a better look: https://www.amazon.com/dp/B07G8VKXM2/

epoch1970
Posts: 3875
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Assign diff IP to eth0 than wlan0 on 3B+ ?

Thu Nov 08, 2018 1:45 pm

Well, I ran through the doc (one-page manuals, I like those) and apparently the device also works as a wifi client if you want. It's described in the Q&A block: a) boot the cam with ethernet, b) download the mobile app, c) in mobile app set cam to wifi network of choice, d) reboot cam & disconnect ethernet.

Since the cam wants to notify the mobile app, or send email and stuff, it wants Internet access. A single network would make that easier.
- If the cam can get ok wifi from the router, you're done.
- If not, you'd need to wire the cam to a switch, and that switch to the router. You can't bridge 2 network segments over wifi (ok you can with a tunnel, but that will twist your brains), so a switch is in, and the Pi is out.
Note that wiring ethernet outside a building should call for specific precautions: UV/weather resistant cable and earthing. Without lightning protection your whole network could go poof in a single strike. Or worse, put the house on fire... If in doubt, do take advice.

If you were a business I would profess to absolutely put the cam in its own network; It surely has vulnerabilities so sandboxing it in its own network, with a router standing guard is a must. But then you'd need to route the notifications and Internet access; with the help of a one-page manual.

HTH
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

PhatFil
Posts: 1437
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Assign diff IP to eth0 than wlan0 on 3B+ ?

Thu Nov 08, 2018 9:16 pm

epoch1970 wrote:
Thu Nov 08, 2018 1:45 pm
Well, I ran through the doc (one-page manuals, I like those) and apparently the device also works as a wifi client if you want. It's described in the Q&A block: a) boot the cam with ethernet, b) download the mobile app, c) in mobile app set cam to wifi network of choice, d) reboot cam & disconnect ethernet.

Since the cam wants to notify the mobile app, or send email and stuff, it wants Internet access. A single network would make that easier.
- If the cam can get ok wifi from the router, you're done.
- If not, you'd need to wire the cam to a switch, and that switch to the router. You can't bridge 2 network segments over wifi (ok you can with a tunnel, but that will twist your brains), so a switch is in, and the Pi is out.
Note that wiring ethernet outside a building should call for specific precautions: UV/weather resistant cable and earthing. Without lightning protection your whole network could go poof in a single strike. Or worse, put the house on fire... If in doubt, do take advice.

If you were a business I would profess to absolutely put the cam in its own network; It surely has vulnerabilities so sandboxing it in its own network, with a router standing guard is a must. But then you'd need to route the notifications and Internet access; with the help of a one-page manual.

HTH
Fwiw i really dont like all these 'cheap' 'smart' home products that rely on dodgy phone apps that require every privilege your phone can offer Needing remote servers and services that could cease operation at the drop of a hat.

might be worth a quick google with your camera specs/id and the word mod, hack, or crack ;) Some have been cracked to varying degrees some you still need the phone app to set up But once networked can be accessed via a web gui rather than the ap, others have had complete system rewrites.. many still have no cracks.. from my very limited experience with a digoo QM something camera, which i shoule be able to use without any app my one evening of fiddling resulted in only getting the dodgy phone app hooked up.. one day tho... ;)

Return to “Advanced users”