Skip to content

Debug Console

Open Debug Console

Connect a USB to RS232 adapter to the Satellite gateway. Please refer to the electrical installation guide on how to achieve this.

After the physical connection is established, you need a proper terminal tool. We recommend one of the follwing:

After installing and opening the tool, choose the port on which the USB to RS232 adapter is connected to. Choose the following settings:

  • Baud rate: 115200
  • Data Bits: 8
  • Stop Bits: 1
  • Parity: None

Open the connection and reboot the gateway by pressing the reset button (the left one). You should see an output like the one shown below. If you do not see any color in the test output, the first thing you should do is to type terminal-detect and press Enter.


       ========================================
      =     .___                        ====== 
     ==     |   | ____   _________      =====  
    ===     |   |/    \ /  _ \__  \     ====   
   ====     |   |   |  (  <_> ) __ \_   ===    
  =====     |___|___|  /\____(____  /   ==     
 ======              \/           \/    =      
========================================       

  Welcome to InoaOS!
  Type 'help' for command list 
  Press <tab> for auto completion


Inoa> _


Basic Usage

The debug console is interactive and can be used like any other OS console. There is an auto-complete feature by pressing the TAB key. Also, you will get a list of all available commands by typing help and pressing Enter.

You might also want to use the "history feature". By pressing the Up and Down key, you will scroll through your last entered commands.

You can abort an already typed command by pressing CTRL+C.

The color code of the output text is quite simple. Green will be used for the prompt and all messages of severity "Info". Yellow is used for "Warnings" and red is used for "Errors".

During the usage of the console, you will see all logs the OS is producing. This might be disturbing if you are just entering a command. But don't worry, just keep typing - your command will still be recognized!

The logs are structured in the following format: Severity (Time) |Issuer|: Message The severity is shown as a single character, while I is for "Info", W is for "Warning" and E is for "Error". The time is shown in milliseconds since the start (boot) of the system. The issuer is the name of the subsystem of the OS. The message itself is the actual log message.

See an example below:

I (5357) |CLOCK|: Time is synchronized to: Thu Mar  9 09:09:17 2023

The subsystem "Clock" is telling you an "Info" that the time has been set to the correct online time in background.

OS Monitoring

Task Manager

Since InoaOS is a realtime OS based on freeRTOS, the scheduling of tasks is quite important. You will get a prioritized list of all running tasks by executing the tasks command.

Task Name       Status  Prio  HWM   Task#  Affinity
-----------------------------------------------------------
main            X       1     6092  4
IDLE            R       0     1684  6
IDLE            R       0     1664  5
tiT             B       18    2496  8
metering_task   B       3     1640  15
ota_task        B       2     2628  14
registry_task   B       4     5516  16
mqtt_task       B       5     3600  17
inoa_events_tas B       1     7568  10
httpd           B       5     3168  13
ipc0            B       24    440   1
sys_evt         B       20    212   9
mdns            B       1     2288  12
esp_timer       S       22    3288  3
wifi            B       23    4048  11
ipc1            B       24    436   2
Tmr Svc         B       1     1464  7

The Status can be one of:

  • "R" for "Running"
  • "B" for "Blocked" that means "waiting"
  • "S" for "Suspended" that means "done"

"HWM" is for "High Water Mark" and represents the amount of memory this task is allowed to use.

Memory

You can check the available memory at any time by typing free. The available part of heap is shown by typing heap. The standard version of the Satellite gateway has 8MB of memory in two banks. The command will only show the lower bank (this high memory bank is used for special buffering, only the low bank is available for task execution), so a maximum of 4MB is shown as free memory.

CPU Usage

Type usage to get the CPU usage for every registered task.

Identity

You can show your gateways ID and pre-shared key by executing the id command. Keep the key secret!

By running the status command, you will see the hardware configuration of your gateway.

Setup / Provisioning

Wifi

The first thing you migth want to setup is your Wifi connection. This is done by the setup-wifi command. The command takes two parameters: the SID and the password. So, a valid command looks like: setup-wifi grayc ad7687612jhfzuifie092lasdhu9. After setting the Wifi configuration, you should reboot the system by executing reboot. This will not be needed any more in future version.

You can check the configuration by typing config, or - more specific - by executing the wifi-status command. This will also show you the strength of your Wifi signal.

Last, but not least, you can check the network connection by executing ip. It shows the network address for every connection. The network IDs are:

  • "sta" for Wifi station connection
  • "ap" for the access point the gateway offers
  • "eth" for ethernet - this is only availibe for specific hardware configuration
  • "ppp" for mobile connections like 4G/5G/NB IoT - this is only availibe for specific hardware configuration

RS485

The gateway version for electrical metering comes with two separate RS485 connections, that must be setup. This is done by the command:

setup-uart <interface> <baud> <databits> <parity> <stopbits>

The interface parameter takes an "1" or "2", to identify the interface you want to setup. The baud rate is the baud rate of the bus you want to connect to. The other parameters are mapped as follows:

<databits>  Data bit mode (0=5bit, 1=6bit, 2=7bit, 3=8bit, 4=Max)
  <parity>  Parity mode (0=None, 2=Even, 3=Odd)
<stopbits>  Stop bit mode (1=1, 2=1.5, 3=2, 4=Max)

Be sure to use reboot after executing the setup command. This will be not needed any more in future versions. After rebooting, you can check the configuration by executing config.