

HongKe
IIoT
Essential Tips for Using HongKe Industrial Raspberry Pi
During the project development process using the HongKe Industrial Raspberry Pi, we will utilize various functions. Some functions may seem insignificant, but they are very important in actual application development. Next, HongKe shares several common issues encountered during the application of the industrial Raspberry Pi and provides solutions to help everyone quickly get started with using the HongKe Industrial Raspberry Pi:
-
RevPi Flat module WIFI configuration issues
-
CODESYS-based serial port application configuration issues
-
FTP server installation application configuration issues
HongKe Technology
Hong
/
Ke
/
Essentials
/
Goods
01
RevPi Flat module WIFI configuration issues
The RevPi Flat module itself supports WIFI functionality, but the WIFI feature of this module is not configured in the same way as a regular Raspberry Pi, and cannot be configured via shortcut commands; it can only be modified through underlying files. The following content will guide how to enable the WIFI function of the Flat module and connect to WIFI.
1. Enter the command line window
2. Input the following code:
nano /etc/wpa_supplicant/wpa_supplicant.conf
3. Add the wifi name and password at the ssid and psk respectively, and save and exit after modification

4. Power off, unplug the network cable, and restart
02
CODESYS-based serial port application configuration issues
Reading sensor data through CODESYS serial or MODBUS RTU protocol is a common application in industry. However, the underlying port numbers of the industrial Raspberry Pi are represented differently from the CODESYS port numbers. Configuring the industrial Raspberry Pi to map its serial ports to the CODESYS port numbers is key to connecting serial devices with CODESYS on the industrial Raspberry Pi. The following content will share how to achieve serial port mapping.
1. Serial port mapping settings
a. Edit /etc/CODESYSControl.cfg;
nano /etc/CODESYSControl.cfg
b. Add the following code at the end of the file:
[SysCom]
Linux.Devicefile=/dev/ttyUSB

c. Restart the device
Note: After this setting, the mapping relationship of the serial port numbers is as follows:
/dev/ttyUSB0 -> COM Port 1/dev/ttyUSB1 -> COM Port 2
/dev/ttyUSB2 -> COM Port 3/dev/ttyUSB3 -> COM Port 4 …
2. Confirm the serial port number
a. Without inserting the serial device, input the following command:
ls -l | grep -i usb

b. Insert the serial device and input the same command to compare in order to obtain the corresponding serial port number of the serial device

3. Verification
Add the serial device in CODESYS, fill in the corresponding serial port number, and log in to the device

03
FTP server installation application issues
During file transfer, users often need to use an FTP server. So how to correctly install and configure the FTP server? Here comes the HongKe tutorial!
1. Try to install directly using the command sudo apt-get install vsftpd. If successful, switch to root permissions and then jump to step 7; otherwise, continue to look at step 2.
2. If the installation fails with a package not found error, as shown in the figure below, you need to change the source.

3. Switch to root permissions using sudo su (the following operations are assumed to have root permissions), then use nano to edit the /etc/apt/sources.list file, delete all the original content, and replace it with the following content:
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main non-free contrib rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main non-free contrib rpi
(After modification, the nano commands used are: 【Exit】Ctrl+X; 【Confirm Save】Y; 【Continue】Enter)

4. Edit the /etc/apt/sources.list.d/raspi.list file, delete all the original content, and replace it with the following content:
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui

5. After editing, execute apt-get update. The speed may be slow, depending on the network environment. If it executes successfully, jump to step 6.

6. If the update times out or takes too long, consider terminating the update with Ctrl+C, then enter the /etc/apt/sources.list.d/ directory, and modify the following two files by adding a # in front of each line to temporarily comment them out. After finishing, delete the # as needed:
revpi.list teamviewer-revpi.list
Then execute apt-get update again
7. Re-execute apt-get install vsftpd, and wait patiently.
8. Edit /etc/vsftpd.conf, find the following line, and remove the # in front of it.
#write_enable=YES
9. Run vsftpd using the following command
service vsftpd start
10. At this point, open any FTP client, such as FileZilla, (the following scenario is the FileZilla test environment).
(1) The FileZilla download version includes client and server versions. Here, download the client version, link: https://filezilla-project.org/download.php?type=client#close
(2) Input the IP address, username (pi), password, and click “Quick Connect” to connect to the Raspberry Pi’s FTP server.

(3) A pop-up may appear during the connection, just confirm it. Note that the files transferred via FTP need to have their permissions changed as needed.

(4) When uploading files via FTP, try to upload to the /home/pi directory, as other directories have permission restrictions that may cause upload failures.
11. To close the FTP server after completion, use the method: service vsftpd stop.


HongKe–Industrial Internet of Things
HongKe is a high-tech company with many years of experience in the Industrial Internet of Things (IIoT) industry. HongKe collaborates with top companies in the world, including EXOR, KUNBUS, HiveMQ, CODRA, etc., to provide advanced high-end Industrial 4.0 industrial touch screens, industrial gateways, edge computing software, MQTT, OPC UA, industrial-grade Raspberry Pi, SCADA, predictive maintenance and other solutions. All members of the IoT department have received professional training and obtained professional qualifications, with an average of over 3 years of technical experience and a consistent level that has won excellent reputation from customers. We actively participate in industry associations and have made significant contributions to the promotion of advanced technology. To date, HongKe has provided various solutions from hardware to software for many users in the industry, and has participated and assisted in numerous OEM equipment research and development and migration projects, as well as smart factory and Industrial 4.0 upgrade projects for end-users.

Scan the QR code for more cutting-edge knowledge on IIoT

Previous Issues
Highlights
RevPi Application Cases · Here
● Achieving industrial protocol and MQTT conversion in a low-code/no-code manner
● Five potential uses of industrial Raspberry Pi as a soft PLC
● Solving three major challenges of IIOT with industrial Raspberry Pi combined with CODESYS
Edge Computing · What Do You Know
● Want to achieve device service? You need a powerful edge device!
● What features should HMI for the food & pharmaceutical industry have?
● Application of intelligent industrial control screen eX707 in underwater remote control robots
What You Want to Know · SCADA
● HongKe Panorama software platform – SCADA solution with unlimited potential
● HongKe Panorama SCADA solution applied in the oil refining industry
MQTT Broker · HiveMQ
● Helping AGV carts communicate with control systems
● IAV application of HiveMQ to build a mountain flood early warning system with automotive data
● BMW’s car-sharing application relies on HongKe HiveMQ for reliable connectivity
Click the “Read Original” below to see more