PAC1934 Energy Metering Using Linux Step 5

Last modified by Microchip on 2023/11/10 11:06

Copy Python Source Files to the Target
Information

Skip to Step 2 if you are using C.

Navigate to the extracted Python Project Files:

​$ cd ~/project/pac1934-linux/src/python

Find the IP address of the SOM1-EK. If you have followed Step 4.9, the IP address of SOM1-EK is 192.168.1.5. To make sure, use ifconfig in SOM1-EK:

# ifconfig

IP address of the SOM1-EK

Figure 1

Go back to the Ubuntu Terminal. Copy the source files to the target using scp. The -r attribute will transfer the contents of a directory:

$ scp -r ~/project/pac1934-linux/src/python root@192.168.1.5:/root/

You will be asked if you want to continue connecting. Just type “yes”, then press Enter.

Next, type the SOM1-EK root password configured in Step 3.3.4.

Ubuntu Terminal

Figure 2

Use ls to check if the files have been received. Go to the SOM1-EK Terminal to do so:

SOM1-EK Terminal

Figure 3

Your Python application is good-to-go. Proceed to PAC1934 Energy Metering Using Linux® Step 6 to run the Python application.


Build C Sample Application from Buildroot

Navigate to the extracted C project files:

$ cd ~/project/pac1934-linux/src/c

Use the following command to prepare environment variables for cross compilation:

$ export CROSS_COMPILE=~/project/my_external_tree/host/bin/arm-buildroot-linux-uclibcgnueabihf-

Run the make command. A successful build will appear as shown in Figure 4:

$ make

A successful build

Figure 4

A file called pac193x_sample_application should show when running the ls command from this directory. Please see Figure 5:

file called pac193x_sample_application

Figure 5

Make sure pac193x_sample_application is executable by running the command below:

$ sudo chmod 777 pac193x_sample_application


Upload the Compiled Code to the Target

Navigate to the extracted C project files:

$ cd ~/project/pac1934-linux/src/c

Transfer pac193x_sample_application to the SOM1-EK using scp:

$ scp -r pac193x_sample_application root@192.168.1.5:~/

Your screen should look appear as shown in Figure 6:

pac193x_sample_application

Figure 6

Use ls to check if the files have been received on the SOM1-EK:

# ls ~/

Your screen should appear as shown in the Figure 7:

files have been received on the SOM1-EK

Figure 7

Learn More

Back to Top