Skip to content

Quick Start Guide

Establishing Host Connection and Power

ModuSio devices can be connected to the Network via Ethernet or Wifi. Please select the tab for your preferred option:

Ethernet: Network and Power Connection

When the MIO01 is connected to the host via Ethernet, the power should be provided via Power-Over-Ethernet.

ModuSio devices are Class 2 (3,84–6,49 W) PoE powered devices. Connect the ModuSio Device to a PoE source that can supply class 2 devices. ModuSios expect the PoE power as phantom power, i.e. using the Ethernet Tx and Rx pins.

PoE connection

The green LED on the MIO01 is turned on to indicate power is ok and firmware is up and running.

Initial Device Configuration

For initial configuration, connect the SERVICE interface to a computer via USB cable and start a terminal program. See Instructions for details.

Press Enter in the Terminal program, and you should see the config prompt:

config>

Configure Device ID

To identify the device in the network, configure a device ID. This ID is used as the network hostname and as a prefix to identify the services provided by the device.

Each device in the network shall have a unique name. The name shall consist only of alphanumeric characters, - and _. Avoid blanks and special characters.

config> device-id MIO01-1
Setting device-id to 'MIO01-1'
A 'reboot' is required to activate the new setting!

Select Ethernet as Host Interface

Configure the device for Ethernet operation. The device is configured for Ethernet when it is NOT configured for Wifi. So we clear Wifi settings:

config> wifi-ssid ""
Delete wifi-ssid

Info

You can ignore the message: Can't set wifi-ssid: ESP_ERR_NVS_NOT_FOUND. This is normal if wifi has not been configured before.

Wifi: Network and Power Connection

When using Wifi, supply the ModuSio by a power supply, capable of delivering 12V..24VDC, 5W. Use contacts 5+6 and 7+8 to supply the power. Polarity doesn't matter.

Wifi connection

The green LED on the MIO01 is turned on to indicate power is ok and firmware is up and running.

Initial Device Configuration

For initial configuration, connect the SERVICE interface to a computer via USB cable and start a terminal program. See Instructions for details.

Press Enter in the Terminal program, and you should see the config prompt:

config>

Configure Device ID

To identify the device in the network, configure a device ID. This ID is used as the network hostname and as a prefix to identify the services provided by the device.

Each device in the network shall have a unique name. The name shall consist only of alphanumeric characters, - and _. Avoid blanks and special characters.

config> device-id MIO01-1
Setting device-id to 'MIO01-1'
A 'reboot' is required to activate the new setting!

Select Wifi as Host Interface

Configure the device for Wifi operation. You need the Access Point's Name (SSID) and a password.

config> wifi-ssid <my-access-point-name>
config> wifi-pw <my-secret-password>

Warning

It is not possible to connect to Access Points that don't require a password.

Troubleshooting Wifi Connection

In case Wifi connection doesn't work, enter reboot in the SERVICE console and check the log messages.

Look for messages beginning with wifi: and io4edge_net:. In case of success, you see something like

...
I (848) wifi:connected with my-access-point-name, aid = 1, channel 6, BW20, bssid = ...
...
I (2573) io4edge_net: Got IP Address
I (2573) io4edge_net: ~~~~~~~~~~~
I (2573) io4edge_net: ETHIP:192.168.1.56
I (2574) io4edge_net: ETHMASK:255.255.255.0
I (2574) io4edge_net: ETHGW:192.168.1.1
I (2574) io4edge_net: ~~~~~~~~~~~
...

If connection establishment isn't successful, you see periodically something like this:

I (6954) io4edge_wifi: Disconnected, reconnect

You can also scan for available access points. To enable wifi scanning, just set a dummy access point name:

config> wifi-ssid foo
config> reboot
...
config> wifi-scan
Total APs scanned = 2
                                    SSID RSSI Channel
                                  slinky -47   6
                            OfficeRouter -53   1

In this quick-start guide we will run demo programs to stimulate the MIO01's binary I/Os and to read values from the analog inputs.

Prerequisites

Hardware

  • A target machine running Linux that is in the same network as your MIO01
  • A development PC (Windows or Linux), connected via Network to the target machine

  • A laboratory power supply capable of supplying 24V/200mA.

Tools on Development PC

The examples are written in programming language Go, we download the go sources and compile them. Therefore we need some tools on your development PC:

Get Demo Software

Clone the repository containing the examples to a folder of your choise (here myworkdir).

c:
cd \myworkdir
git clone https://github.com/ci4rail/io4edge-client-go.git
cd io4edge-client-go
cd ~/myworkdir
git clone https://github.com/ci4rail/io4edge-client-go.git
cd io4edge-client-go

Binary I/O Demo

The binary I/O demo stimulates the binary outputs of the MIO01 one after another. Supply the binary I/O groups with 24V, so when the output switch turns on, the corresponding LED illuminates.

You will see a running light on the four LEDs.

Connecting

Plug a mating connector to the two top connectors of the MIO01.

Mating connectors for MIO01:

Connect the CI and CO pins to your laboratory power supply which is set to a voltage of 24V (up to 110V).

Warning

Voltages over 60V are dangerous! If voltages above 60 V DC are used, ensure that all necessary protective measures are taken and that only qualified personnel is using the equipment.

Connection for Binary I/O Demo

Demo Software

Compile Demo

The demo must be compiled for the architecture of your target machine. Typical targets are: - modern x86 PCs: Architecture = amd64 - RaspberryPi (32 Bit): arm - ModuCop: arm64

In the following examples, we use arm.

Run this in a powershell console

cd examples\binaryIoTypeA\blinky
$Env:GOOS = "linux"
$Env:GOARCH = "arm"
go build
cd examples/binaryIoTypeA/blinky
GOOS=linux GOARCH=arm go build

This produces the binary file blinky in the current folder.

Copy Demo to target machine

Transfer the compiled binary. Replace <target-ip> with the IP address of your target machine.

scp blinky <target-ip>:~/.

Running the Demo

Login into your target machine over SSH:

ssh <target-ip>

Once logged in into the target machine's Shell, run the demo.

./blinky MIO01-1-binaryIoTypeA

You should now see the binary I/O LEDs running in sequence.

Analog Input Demo

The analog input demo samples one analog input of the MIO01 for 10 seconds at the sample rate specified on the command line. The sampled values are printed.

Connecting

Plug a mating connector to the third connector from the top of the MIO01.

Mating connectors for MIO01:

Connect the 0V and Uin1 pins to your laboratory power supply, set to 5V.

Connection for Analog Input Demo

Demo Software

Compile Demo

The demo must be compiled for the architecture of your target machine. Typical targets are: - modern x86 PCs: Architecture = amd64 - RaspberryPi (32 Bit): arm - ModuCop: arm64

In the following examples, we use arm.

Run this in a powershell console

cd examples\analogInTypeA\stream
$Env:GOOS = "linux"
$Env:GOARCH = "arm"
go build
cd examples/analogInTypeA/stream
GOOS=linux GOARCH=arm go build

This produces the binary file stream in the current folder.

Copy Demo to target machine

Transfer the compiled binary. Replace <target-ip> with the IP address of your target machine.

scp stream <target-ip>:~/.

Running the Demo

Login into your target machine over SSH:

ssh <target-ip>

Once logged in into the target machine's Shell, run the demo.

./stream MIO01-1-analogInTypeA1 400 | more

You should now see the sampled values together with the timestamp:

Started stream
got stream data seq=1 ts=22224066708
  #0: ts=22223821033 0.5076
  #1: ts=22223823468 0.5077
  #2: ts=22223825968 0.5076
  #3: ts=22223828468 0.5077
  #4: ts=22223830994 0.5077
  #5: ts=22223833468 0.5076
  #6: ts=22223835968 0.5077
  #7: ts=22223838468 0.5077
  #8: ts=22223841003 0.5077
  #9: ts=22223843468 0.5077
  #10: ts=22223845968 0.5076
  #11: ts=22223848468 0.5076
  #12: ts=22223850999 0.5076
  #13: ts=22223853468 0.5076
  #14: ts=22223855968 0.5077
  #15: ts=22223858468 0.5076
  ...

The sampled values are normalized, so 1.0 represents full-scale (10 V). Timestamps are expressed in microseconds since the start of the MIO01.