Integration Guide
Overview
This integration guide explains how to bring up and configure the current product revision of the miro EdgeCard mioty. All documentation is in a preliminary state.
Theory of operation
The mioty BSM is implemented and running on the miro EdgeCard. It exposes a USB CDC ECM device to the host system.
To integrate the card with a host system, the following steps are needed
- Configure the host system network to send traffic to and from the card using a NAT setup
- Configure the mioty BSM on the card with necessary keys and service center URL
Integration
Host System Networking
The miro EdgeCard mioty is providing a USB CDC ECM network interface and is configured to use static IP 172.30.1.2/24. Configure host system IP address to be in the same network (e.g., 172.30.1.1).
Setup ip tables to look like this
?> cat /etc/iptables/iptables.rules
*nat
:PREROUTING ACCEPT [64:15947]
:INPUT ACCEPT [47:14726]
:OUTPUT ACCEPT [8:496]
:POSTROUTING ACCEPT [7:420]
-A POSTROUTING -o eth1 -j MASQUERADE
COMMIT
*filter
:INPUT ACCEPT [1102989:1312630655]
:FORWARD ACCEPT [1634:182445]
:OUTPUT ACCEPT [419031:1280236444]
-A FORWARD -i eth2 -j ACCEPT
COMMIT
Use the following command sequence to set up configuration as mentioned above using the correct interface names
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth2 -j ACCEPT
Enable ip forwarding in kernel
Card Configuration
The card is exposing a linux shell on /dev/ttyACM0. Use a tool like minicom to log in into the system (user: root, no password).
On the card, there is a systemd service mioty_bs providing the mioty basestation service on the card. The mioty BSM configuration is done through a xml file in /root/mioty_bs_config.xml.
Set these parameters according to your needs:
- uniqueBaseStationId
- serviceCenterAddr
- serviceCenterPort
The config file will look like this
<module name="root">
<module name="bsi">
<parameter name="uniqueBaseStationId">9c-65-f9-ff-fe-61-07-c7</parameter>
<parameter name="baseStationName">miro-edge-mioty-hybrid</parameter>
<parameter name="baseStationInfo"/>
<parameter name="baseStationVendor">Miromico</parameter>
<parameter name="baseStationModel">edge-mt-868-lte</parameter>
<parameter name="serviceCenterAddr">eu3.loriot.io</parameter>
<parameter name="serviceCenterPort">727</parameter>
<parameter name="tlsAuthRequired">true</parameter>
</module>
<module name="mps">
<parameter name="profile">eu868</parameter>
</module>
</module>
The mioty BS is requiring certificates to establish a secure connection with the service center. Create a folder tls_certificates in /root/mioty_bs and copy the following TLS certificates and keys from the service center into those files:
- root_ca.cer
- bstation.cer
- bstation.key