RoadTest: RoadTest the Raspberry Pi 4 Model B (2GB)
Author: skywalker1211
Creation date:
Evaluation Type: Development Boards & Tools
Did you receive all parts the manufacturer stated would be included in the package?: True
What other parts do you consider comparable to this product?: Nvidia Jetson Nano
What were the biggest problems encountered?:
Detailed Review:
There are several benchmarks done on raspi4.
https://www.raspberrypi.org/magpi/raspberry-pi-4-specs-benchmarks/
https://medium.com/@ghalfacree/benchmarking-the-raspberry-pi-4-73e5afbcd54b
I will skip performance benchmarking, and focus on user experience on raspberry pi 4 in my home automation project.
I have been using raspi for home automation for several years, from raspberry pi 1, 2 and now 4
System Setup:
There are three 3-Way wireless switches, can control 9 lights. I design the switch myself, using ESP32, and program it as a generic MQTT thing.
There is sensor tag from TI, to provide temperature, illuminance, and atmospheric pressure reading.
Raspberry pi acts as hub to receive reading from sensortag, and control light based on some rules.
Actual hardware photo as below.
Connectivity:
WiFi
What I like the most is the connectivity on raspi 4. It comes with WiFi and BLE.
Although raspi3 already equipped with wifi/ble, but I do not own raspi3. I am upgrading from raspi2 to raspi4, it does impress me a lot.
Comparing to raspi2, which I use WiPi dongle for wifi connectivity. WiPi dongle is not stable. it disconnects at least once a week, and require me to plug out and in the dongle to reset it. This is frustrating especially I am away from home. My home just went disconnected when it happened.
I have been running raspi4 since 23 August and the wifi gives no problem up to this time.
Bluetooth
Raspi4 also come with BLE. I have a TI CC2650STk sensor tag quite sometime ago, this is a good opportunity to integrate the it into home automation.
Same with WiFi, BLE does not give any problem so far.
Home Automation:
I use hassle free openhab setup - openHABian instead of Raspbian. This is the faster way to setup openhab in raspberry pi.
Installation guide for openHABian is available here - https://www.openhab.org/v2.4/docs/installation/openhabian.html
In addition, I setup MQTT broker in raspberry pi. All devices communicate using MQTT.
Instruction to set up mosquitto MQTT broker can be found here - https://appcodelabs.com/introduction-to-iot-build-an-mqtt-server-using-raspberry-pi
The smart switches will connect to this MQTT broker.
In order to read sensortag from BLE, I write a python script to retrieve sensor reading from BLE and forward it to a MQTT topic. So openhab will only deals with MQTT things.
More info to read from sensortag and MQTT client in raspberry pi as below:
https://appcodelabs.com/introduction-to-iot-build-an-mqtt-server-using-raspberry-pi
https://github.com/yxtay/raspberry-pi-sensortag
Some simple rules are running background for lighting control.
I have three tasks running in raspberry pi 4
System Boot-Up Time:
This parameter determine how fast my home goes online once I power up raspberry pi.
It is measured from power up->openhab server is up (until I can access the webapp and control light)
I do not have accurate timer to measure this, but using a stopwatch to start count once the power is on.
Raspberry pi 4 took 50.91 seconds to bring my home online. It is not 100% accurate, but it would not be very far away from this number.
My expectation is ~30seconds for home automation application. But 50s is good enough, comparing to raspberry pi 1 and 2, which took minutes, or sometime >5mins (raspi1).
Webapp Loading Time:
Once the system is running, it can be accessed via web browser, example layout as below.
It is important to know how long it takes to load the website, as I do not wish to wait for few seconds just to log in to my home automation page.
With browser cache cleared, it took 309ms to load the page. This is pretty fast, can only notice minor delay in loading page.
With browser cache, the page is loaded in 86ms. It is equal to instant response.
Control Latency:
This is measured from control update is sent via webapp->the light is turned on.
I do not have tools to measure the actual latency. I can only comment the feeling of the latency, which I feel almost immediate control. As shown in video below.
System Resources:
CPU usage recorded highest at 22.4% when I am operating openhab webapp. Raspi4 can definitely handle more tasks.
Memory usage is at 13.2%, Same with CPU usage, we still have some capacity for other tasks.
The entire setup uses 2375MB.
Temperature:
Raspberry pi is operating without casing nor heatsink. Room temperature is 31.4 Celsius
Core temperature : 51.4 Celsius
WiFi/BLE module: 47.7 Celsius
RAM: 43.5 Celsius
It is expected to not having high temperature because raspberry pi is not operating at full load.
Summary:
The processing power of raspberry pi 4 is powerful, and more than enough for my application. From the cpu and ram usage, I could do more than just smart switches and sensor.
The connectivity make it a good board as IoT gateway/hub. I need only 1 cable (power cable) to run it. I have flexibility where to install it. This is the part I like it the most.
To push data to cloud, it is good to have security chip, as well as Sigfox/4G support. Even though I could do it with external USB device, it will be plus point if raspberry pi come with these. And it would make it an ideal candidate for IoT application.
User experience is very good for using raspberry pi 4 to run openhab. System up within a minute, webapp and control latency is almost instant. Entire system runs very smoothly.
No concern on temperature, as it is not building up from time to time. No rebooting issue after running 24/7 for 1 month.
The user experience is better than raspberry pi 2, as there is noticeable delay for light control. And way better than raspberry pi 1.
Potential application:
Probably will eat up all processing resources.
Update 25/9/2019:
Update SensorTag's firmware. Modify python script to get humidity and battery reading.
I try to load raspberry pi with more processes, so I added pi camera as security camera, stream it using VLC and openhab display the stream.
live stream pi camera -> https://www.lewisroberts.com/2015/05/15/raspberry-pi-mjpeg-at-30fps/
display on webapp -> Part 2/3: OpenHAB + RPi + LEDs + Camera | Slavko Žitnik
Updated block diagram, hardware photo and UI.
No big difference in boot up time.
page loading time increase by average 200ms. It is from loading live video. nothing to do with raspi processing power
surprisingly vlc stream does not take up much processing power. also consume small amount of ram 1.3%.
No big difference in temperature.
Update 28/9/2019:
Software update.
Decided to test if raspberry pi can handle image processing task. Thus I enhance home automation with smart camera feature.
In last update, I stream live video using VLC. I cant use VLC if I wish to grab and process the image before streaming it out.
change another way to grab image from pi camera and stream it. and openhab receives the stream.
It can be done by python script with flask.
Process image and stream the image ->https://www.pyimagesearch.com/2019/09/02/opencv-stream-video-to-web-browser-html-page/
Instead of implement motion detector as described in above link, i decided to go for more advance detector, using tensorflow object detection api. It should give better detection result.
Reference - https://github.com/EdjeElectronics/TensorFlow-Object-Detection-on-the-Raspberry-Pi/blob/master/README.md
Now I have 4 tasks running in raspberry pi 4
The detection result is impressive (as running in raspberry pi 4).
Detector is running at ~1 frame per second, can detect person accurately.
What I am interested is detecting person. I set it to send me notification if detect any person with >70% confident level.
now we can see raspberry pi is running at ~250%. RAM left 884mb. Tensorflow consume the most ram and cpu usage.
Tensorflow and related packages use a lot of space. my 16gb card still sufficient
There is increase in temperature in three major components. core temp increase the most(~10c)
Core temperature : 61.3 Celsius
WiFi/BLE module: 52.9 Celsius
RAM: 50.2 Celsius
Measurement from cli is 68c, perhaps surface temperature is lower than actual core temp.
Openhab webapp performance still as good as before. slightly increase in page loading time (by 50ms). Overall feeling still good.
Raspi4's performance is really good, and I will stick with it for my home automation project (until release of raspberry 5/6).
Top Comments
Thanks!
i do not sure about openhab scripting. I use rules to automate some tasks.
you can refer this link. https://www.openhab.org/docs/configuration/rules-dsl.html
i use openhab cloud instead of port forwarding…
Nice road test report.
DAB
Nice RoadTest and good use of OpenHAB.
I used OpenHAB 2 for the MATRIX Creator and Raspberry Pi 3 A+. You can do scripting with Python using Exec Bindings in OpenHAB. It takes a bit of work to getting it…