The Shed

IMPROVING YOUR MOTORHOME’S TECHNOLOGY —

Building a secure and efficient WiFi network for a camper van

- By Enrico Miglino Photograph­s: Enrico Miglino

In the previous issue, we installed what I consider to be one of the most essential components of our smart van project: the solar cell and the inverter to give 220V AC.

In this second instalment, we will prepare and install the hardware needed to create the internal network. We will demonstrat­e the configurat­ion and show the set-up working properly in the next issue of The Shed.

I have also installed a fixed 21-inch LCD monitor — useful not only for work but also for leisure.

The projects to create this smart van, including some original solutions to make the environmen­t secure, have been possible thanks to element14. com, for providing part of the hardware, Altium Designer (at altium. com) for the circuit design, PCBWay. com, for the creation of the prototype PCB boards here and there, and the invaluable helpful contributi­on of my friend Jan Cumps, one of the most eclectic and proficient electronic engineers I have ever met.

Mobile hotspot

The easiest way to provide internet access on the move is to use a smartphone mobile hotspot. The disadvanta­ge is that not all devices can support multiple connection­s. Another problem is the limited amount of data that can be exchanged according to our personal mobile data plan. In my case, for example, I am using two different SIM cards with 40Gb a month each, but every time I change the hotspot settings the connected devices lose some of the previous configurat­ions.

The other issue occurs when I need to move out of the van: the whole internet connection goes down, as well as the connection­s between the devices.

Conclusion: this method is useful only with a small number of devices, and only works if the devices do not exchange data between themselves — where no internet is needed.

Mobile router

This is another handy solution for limited requiremen­ts. These devices — some of them are provided by the mobile operator — are essentiall­y identical to the home ADSL or fibre optics home router.

After powering the mobile router, you have a WiFi connection available to connect your nearby devices. One of the problems with mobile routers is they are not very secure; they are easy to hack. I prefer not to use them, especially when I need to use the internet to access sensitive data such as online payment, etc.

Indeed, the smart way to use a mobile internet router is to have an extra SIM with its own unlimited monthly data plan.

Public or pay-as-you-use WiFi spots

This is another solution, available in many campsites, but I have already tried it with poor results.

In most cases, it is a service at the campsite or road stop area, but it requires access to the internet login from a browser. What if you have two devices — for example, a laptop for working and the Amazon Fire TV Stick for watching your favourite series on Netflix? You need to pay twice and, if you need to connect multiple devices together, such as a MacBook and an iPad, there is no way to share the network.

The Raspberry Pi network and control panel

The van network essentiall­y uses a couple of Raspberry Pi 4B connected through a 1Gb Ethernet switch. I tried to design the network architectu­re so it’s easy to implement and maintain; thanks to the power of the Raspberry Pi 4B Linux Machine, the existing devices can be expanded upon, adding more features without the investment of a lot of money.

Having a network inside the van that is almost identical to the one at home has the advantage of being able to configure one of your devices to connect to the WiFi access point.

In addition, all the devices connected to the campervan network can communicat­e and exchange data even

This is the third device of the main node inside of the van — the main node consisting of three Raspberry Pi 4B 4Gb devices — with its role being a rear camera for motion detection when in ‘security mode’, as well as a rear dashcam.

As the USB webcam is used for several different roles that can be easily selected by the user, instead of an automated system, I opted for a custom setting supported by the power of the Linux operating system.

Instead of a long-distance USB power cable of about six metres, I decided to wire the Raspberry Pi power supply with a 220V cable. This solution is more efficient for the whole current plant as the impedance of the 5V DC over a long cable may be a risk factor, as well as increase the power consumptio­n.

The set-up of the wires shown in the photos is not the final one; until we are sure after a complete test that the system runs without problems, it is good practice not to fix the wiring to its permanent position.

The last image shows the camerastre­aming test on a laptop; the streaming will be accessible from any device connected to the van network through a fixed IP address. This Raspberry Pi hosts 120Gb SSD storage; it will be used for circularly storing the dashcam video sequences. If any accident or dispute occurs, it is possible to review the last few hours of recording in blocks five minutes in length.

The final set-up of the rear camera: the exposed wiring is protected. The flexible cable cover connecting the camera and the Raspberry Pi 4B is needed because the back door will open. However, the white cable duct will be covered by a mattress.

The internal Raspberry Pi 4B is connected to the router through the Ethernet cable. This device acts as the bridge between the router and the internal network. It is the van WiFi access point to which all the other devices — laptop, tablet, etc. — should connect. Both this device and the rear camera are ‘headless’, meaning they do not need any display as they will work automatica­lly. The image shows the first test set-up with five 220V plugs.

Not all the initial settings worked as I expected. In the first 220V plug set-up, I used a five-plug power strip, then I realised that three were permanentl­y occupied by the Raspberry Pi power supply — it is not a matter of the number of devices you connect but of the overall power required — so I replaced it with a longer power strip, in a more accessible, under-the-table position.

I strongly recommend using a power strip with surge protection; that way, if something occurs the power to the plugs is immediatel­y cut to avoid damaging the connected devices.

when there is no internet connection; this means that all the network operations can be completed at any time.

Using the dual-Pi architectu­re, it is possible to include a firewall between the two devices — the installati­on and configurat­ion of the software will be shown in detail in the next issue — to block access to certain sites, control the data traffic, and avoid intruders accessing your devices through a public network.

The dual-Pi architectu­re

The first Raspberry Pi 4B, named ‘outside’, acts as a router; when it starts it attempts to access the external WiFi access point — if any — and creates an internal Ethernet network: its IP address is 192.168.100.1 and all the other devices that will connect to the Ethernet switch will have an IP address in the same net. A group of 100 addresses is also reserved to assign them via DHCP (Dynamic Host Configurat­ion Protocol). The second Raspberry Pi 4B, named ‘inside’, acts as a bridge; it is connected through the switch to the same Ethernet as the router and behaves as a WiFi access point to which any device can connect wirelessly.

With this configurat­ion, regardless of whether or not the Pi is connected outside to the internet, all the devices connected

to the van network can interopera­te. If there is internet access, any device can also navigate the web, send and receive emails, etc.

Using a Raspberry Pi 4B may sound like a redundant choice; however, these machines have sufficient processor power to perform other tasks at the same time. The router, for example, is assembled with a seven-inch touchscree­n and a Pi camera as it is also the control panel for the entire project, with a graphical touch user interface, and is part of the installed alarms.

The rear camera

I based the rear camera design on a Raspberry Pi 4B, a 120Gb SSD, and a wide-angle USB high-definition webcam. On Amazon and other online providers, you can find good-quality rear cameras for between $150 and $200. What is the difference with this custom solution?

Again, using a Linux-powered system, it is possible to achieve results difficult to find in a commercial product — at least, for a similar price and in a single/ combined product.

As we will see in the coming instalment­s, the rear camera can perform many tasks: dashcam rear camera with circular storage, parking assist camera with graphic overlay, motion detection camera, and alarming module.

Installing the external monitor

I need to take a few moments to explain what I think are the advantages of an LCD display over a digital terrestria­l, or satellite, television system. I see many campers with an external TV antenna or, in some cases, a satellite antenna on the roof and the TV cabling inside.

Nowadays, I think it is easier to use an internet receiver that accesses more or less the same digital content as what is available on terrestria­l television. There are very few events, including sport, that are not available through some internet broadcasti­ng channel and need a digital TV system or a satellite receiver. The price of a campervan television system is considerab­ly higher than for an internet streaming set-up; plus, apps are now available for almost all digital TV services.

The availabili­ty of a good HDMI display is a pretty good option for the second screen of a laptop, as well as working with a tablet with a more comfortabl­e, larger screen.

There are two possible options: a 12V monitor that can be directly powered by the van’s 12V power system or a 220V monitor; as mentioned in the previous issue, the important parameter to take into account is the power of the device. If you are buying one, it’s probably a good idea to search for a 12V DC monitor. I already owned a couple of 21-inch 220V AC LG monitors as spare components so I decided to use one of them. The device comes with its power adapter and the power needed is max 25W so I decided to use it without purchasing a new one.

To easily change the viewing angles, I fixed it to lightweigh­t extensible support with a screen inclinatio­n of about 30 degrees. It is possible to move the screen into different positions, including being able to see it from outside of the van, through the side door.

I have also added a Bluetooth audio transmitte­r to connect a Bluetooth speaker or headphones, avoiding extra cabling.

A four-plug power strip fixed to the extensible arm can power the whole installati­on. When not used as the additional laptop screen, it is connected to an Amazon Fire TV. As it is a full-HD display, it can also be used to connect games consoles.

 ?? ??
 ?? ?? A 21-inch, full-HD, HDMI monitor has been fixed on the high side of the van wall. This is a multifunct­ion device to be used as the second laptop monitor, but not only so. To make it easy to position for multiple points of view, I have used a lightweigh­t extendable wall mount. For better robustness, I fixed the base of the mount to the external wall of the shower, doubling the thickness — the wall is 15mm compact plywood — with four blocks of the same material. The assembly is locked with four 30mm screws that also act as seals for the holes.
Detail: scheme of the joint ‘clamping’ the monitor’s 2mm-thick monitor support between the wooden wall and the block on the opposite side.
A 21-inch, full-HD, HDMI monitor has been fixed on the high side of the van wall. This is a multifunct­ion device to be used as the second laptop monitor, but not only so. To make it easy to position for multiple points of view, I have used a lightweigh­t extendable wall mount. For better robustness, I fixed the base of the mount to the external wall of the shower, doubling the thickness — the wall is 15mm compact plywood — with four blocks of the same material. The assembly is locked with four 30mm screws that also act as seals for the holes. Detail: scheme of the joint ‘clamping’ the monitor’s 2mm-thick monitor support between the wooden wall and the block on the opposite side.
 ?? ??
 ?? ??
 ?? ??
 ?? ?? The wall-mounted 21-inch monitor is not only used as the second screen of the laptop but can also be good for entertainm­ent media. Behind the support, there is also a multiple power supply in which to plug either the Amazon Fire Stick, to enjoy Netflix and Prime, as well as loads of other digital channels, or video games. It is also possible to set the screen to be visible from the outside of the van; the HDMI audio output is plugged in a USB-powered transmitte­r to use the headphones or a Bluetooth speaker when I am watching my favourite TV shows from outside the van.
To create the protected LAN/WiFi access point, the two Raspberry Pis need to be wired through a wired Ethernet network. As these devices can work at 1Gb max Ethernet speed, I have connected them to a high-speed Ethernet switch. Using a five-port switch device — or eight in this case — it is possible to connect up to five other five devices, such as laptops, to achieve the highest data transfer instead of just relying on the WiFi connection speed.
The wall-mounted 21-inch monitor is not only used as the second screen of the laptop but can also be good for entertainm­ent media. Behind the support, there is also a multiple power supply in which to plug either the Amazon Fire Stick, to enjoy Netflix and Prime, as well as loads of other digital channels, or video games. It is also possible to set the screen to be visible from the outside of the van; the HDMI audio output is plugged in a USB-powered transmitte­r to use the headphones or a Bluetooth speaker when I am watching my favourite TV shows from outside the van. To create the protected LAN/WiFi access point, the two Raspberry Pis need to be wired through a wired Ethernet network. As these devices can work at 1Gb max Ethernet speed, I have connected them to a high-speed Ethernet switch. Using a five-port switch device — or eight in this case — it is possible to connect up to five other five devices, such as laptops, to achieve the highest data transfer instead of just relying on the WiFi connection speed.
 ?? ??
 ?? ??
 ?? ??
 ?? ??
 ?? ??
 ?? ??
 ?? ??
 ?? ?? The outside Raspberry Pi 4B has been assembled inside a case, together with the seveninch touchscree­n display. This Raspberry Pi unit does not only act as the external WiFi-to-Ethernet router but will also be used as the main control panel — as we will see in the next issue.
The original case has been modified to host a 120Gb SSD used for historical data storage and for hosting the Raspbian Linux File System — normally installed on the MicroSD — for better performanc­es and longer life for the main data storage. The fact is, when stressed by frequent data read/write cycles, MicroSD cards can often fail.
The outside Raspberry Pi 4B has been assembled inside a case, together with the seveninch touchscree­n display. This Raspberry Pi unit does not only act as the external WiFi-to-Ethernet router but will also be used as the main control panel — as we will see in the next issue. The original case has been modified to host a 120Gb SSD used for historical data storage and for hosting the Raspbian Linux File System — normally installed on the MicroSD — for better performanc­es and longer life for the main data storage. The fact is, when stressed by frequent data read/write cycles, MicroSD cards can often fail.
 ?? ??
 ?? ??
 ?? ??
 ?? ??
 ?? ??
 ?? ??
 ?? ??
 ?? ??

Newspapers in English

Newspapers from Australia