IMPROVING YOUR MOTORHOME’S TECHNOLOGY —
Building a secure and efficient WiFi network for a camper van
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 demonstrate the configuration 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 environment 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 contribution 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 disadvantage is that not all devices can support multiple connections. 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 configurations.
The other issue occurs when I need to move out of the van: the whole internet connection goes down, as well as the connections 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 requirements. These devices — some of them are provided by the mobile operator — are essentially 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 essentially uses a couple of Raspberry Pi 4B connected through a 1Gb Ethernet switch. I tried to design the network architecture 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 communicate 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 consumption.
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 camerastreaming 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 automatically. 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 permanently 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 immediately 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 architecture, it is possible to include a firewall between the two devices — the installation and configuration 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 architecture
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 Configuration 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 configuration, regardless of whether or not the Pi is connected outside to the internet, all the devices connected
to the van network can interoperate. 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 touchscreen 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 instalments, 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 terrestrial, 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 terrestrial television. There are very few events, including sport, that are not available through some internet broadcasting channel and need a digital TV system or a satellite receiver. The price of a campervan television system is considerably higher than for an internet streaming set-up; plus, apps are now available for almost all digital TV services.
The availability 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 comfortable, 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 lightweight extensible support with a screen inclination 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 transmitter to connect a Bluetooth speaker or headphones, avoiding extra cabling.
A four-plug power strip fixed to the extensible arm can power the whole installation. 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.