Simple Serial Reading Example

Installing Screen #

You’ll need to start by installing screen using the Omega’s package manager opkg. We’ll start by updating our list of packages:

opkg update

Now we’ll install screen:

opkg install screen

And now you’re ready to use screen with the UART!

Running screen #

To use the UART with screen enter the following command:

screen /dev/ttyS1 230400

The terminal will go blank, and the command works the following way:

  • Any keys or letters you type are immediately sent to the UART (The metrology engine)
  • The terminal will immediately display any data received from the UART (ie. from the device connected to it)

Copy and paste on the terminal this command to get the internal temperature of chip 1

{"chip": "1","operation": "getTemp"}

The metering engine should respond something similar to:

{"value": "19", "chip": "1","operation": "getTemp"}

this will be the basis for all our interactions with the metering engine.