Getting Started
Where to begin guide for ATDM
Welcome to the ATDM Getting Started Guide. This guide will help you set up your hardware and software so that you can begin using the ATDM product effectively.
Introduction
This guide will cover the following topics:
Required equipment
Hardware setup
How to utilize the following interfaces:
Ethernet
LTE Modem
GPS
USB Ports
Audio Out
Digital I/O
Analog Inputs
RS485
CAN Channels
Equipment
To get started, ensure you have the following equipment:
Serial port interface: 1.8V logic level (e.g., TTL-232RG-VREG1V8-WE or similar)
Harnesses: Main 35-pin and secondary 14-pin cables
Antennas: 3-in-one cable for LTE, WiFi and GPS
Ethernet: Industrial-grade cables
SIM card: Activated (if purchased through Andromeda it is activated)
Hardware Setup
Connecting Serial Terminal
Connect the ATDM to the serial port interface
Configure a serial terminal application to 115200 baud (e.g., TeraTerm)
Power on the ATDM
Verify there is output on the terminal on the terminal screen.
Linux Terminal
The ATDM should boot into Linux.
The default username/password is
torizon/atdmatdm
. You will be prompted to change the password on boot.
Ethernet
Connect the Ethernet Cable:
Connect an Ethernet cable to the Ethernet port of your ATDM device.
Ensure the other end of the cable is connected to your network (e.g., a router or switch).
The top Ethernet connector is the primary (ethernet_1) port.
Automatic IP Assignment:
TorizonOS is configured to use DHCP (Dynamic Host Configuration Protocol) by default, which means it will automatically request and receive an IP address from the network’s DHCP server.
Retrieving the IP Address
Accessing the Terminal:
You can access the terminal on the ATDM device either through a connected display and keyboard or via a serial console.
Alternatively, you can establish a serial connection using a USB-to-serial adapter and a terminal emulator like Putty.
Using
ifconfig
to Get the IP Address:Open the terminal on the ATDM device.
Execute the following command to display the network interfaces and their configurations:
Look for the
inet addr
field under theethernet1
interface, which will show the assigned IP address.
Establishing an SSH Connection
Install Putty (if not already installed):
Download and install Putty from Putty's official website.
Configuring Putty for SSH:
Open Putty.
In the "Host Name (or IP address)" field, enter the IP address obtained from the
ifconfig
command.Ensure the "Connection type" is set to SSH.
Click "Open" to initiate the SSH connection.
Logging In:
When prompted, enter the username and password for your TorizonOS account. By default, the username is usually
torizon
, and you can set a password during the initial setup or use the default if it is provided.
Example Commands and Usage
Checking Network Status:
This command displays all network interfaces and their statuses.
Pinging a Network Device:
Replace
<IP_ADDRESS>
with the IP address of another device on the network to test connectivity.Transferring Files via SCP: From your local machine:
Replace
<IP_ADDRESS>
with the IP address of the ATDM device and/path/to/remote/directory
with the desired directory on the ATDM.
Troubleshooting
No IP Address Assigned:
Ensure the Ethernet cable is securely connected.
Check the DHCP server on your network to ensure it is functioning correctly.
Restart the ATDM device and reconnect the Ethernet cable.
Cannot SSH into Device:
Verify the IP address using
ifconfig
.Ensure SSH is enabled on the ATDM device.
Check network firewall settings that might be blocking the SSH port (default is 22).
Conclusion
Using and interfacing with Ethernet on TorizonOS for your ATDM product is straightforward, with automatic IP assignment and easy access to network configurations through standard tools like ifconfig
. Establishing an SSH connection with Putty or similar tools allows for remote management and operation, enhancing the device’s functionality and ease of use.
LTE Modem
List of modems on ATDM
To verify modem detection, use either subsystem utilities (like lsusb
) or mmcli
.
This shows one modem. The index (0) is used in subsequent commands to interact with the modem.
Enable Modem
To enable the modem, run:
Detailed Modem Information
To retrieve detailed information about your modem, use the following command:
This command will provide detailed information divided into several sections. Here's an example output:
Key Sections:
General: Displays the DBus path and device ID.
Hardware: Provides details about the modem's manufacturer, model, firmware revision, hardware revision, supported technologies, and equipment ID.
System: Shows the device path, drivers, plugin used, primary port, and all associated ports.
Numbers: Lists the modem's own number.
Status: Indicates the SIM lock status, unlock retries, modem state, power state, access technology, and signal quality.
Modes: Details the supported and current modes.
Bands: Displays the supported and current frequency bands.
IP: Shows the supported IP types.
3GPP: Lists the IMEI, operator ID, operator name, and registration status.
3GPP EPS: Shows the user equipment mode of operation.
SIM: Provides the DBus path to the SIM.
Use this detailed information to manage and troubleshoot your modem effectively.
4. Handle SIM Lock
If the SIM is locked, you can unlock it using the SIM index found in the detailed information (/org/freedesktop/ModemManager1/SIM/0
). Replace 1234
with your SIM's PIN:
You can find more PIN-related commands in the mmcli
man page.
5. Connect to the Modem
After enabling the modem, you can connect to the cellular network using the APN for Hologram.
A bearer object is created and can be seen at the bottom of the output from mmcli -m 0
:
You can get information related to this bearer by executing:
As shown, the cellular connection has been established. NetworkManager is already configured to create routes for the new network interface.
You can verify the connection by looking at the output of ifconfig
(NetworkManager will auto-connect on the next modem registration):
Set Cellular Connection Retries
To handle intermittent connectivity, configure ModemManager to retry connections indefinitely. The default is four retries. Set it to zero for infinite retries:
GPS
ModemManager supports location discovery using Global Positioning System (GPS) or mobile network infrastructure.
To check GPS-specific location capabilities:
The capabilities determine which location sources the modem supports and can be enabled. To enable any of the listed capabilities, use the following command:
To get the current location (dummy data shown):
USB Ports
Existing USB Ports on ATDM
Type-C OTG Port: This can be used for USB On-The-Go, allowing the device to function as either a host or a peripheral.
Debug Port: Typically used for development and debugging purposes.
Expansion Options
To expand the USB ports, you can use external USB hubs or leverage the internal capabilities of the ATDM. Here are some approaches:
External USB Hub:
Self-Powered USB Hub: Use a self-powered USB hub to add multiple USB ports. This hub is powered by an external power supply and can support multiple USB devices without overloading the Verdin SOM.
Bus-Powered USB Hub: Alternatively, use a bus-powered USB hub that draws power from the Type-C OTG port. However, this might be limited by the power available from the port.
Audio Out
ATDM provides robust audio output capabilities, making it suitable for various applications requiring high-quality sound. Here’s an in-depth look at the audio output features and how to utilize them effectively.
Audio Hardware Features
High-Fidelity Audio Output: The ATDM is equipped with high-quality DACs to ensure clear and crisp audio output, suitable for both voice and music playback.
Standard Audio Connectors: The device includes standard 3.5mm audio jacks and may also support digital audio outputs like HDMI or SPDIF, providing flexible options for connecting to external speakers or audio systems.
Software Tools for Audio Management
aplay: A simple command-line audio player for ALSA (Advanced Linux Sound Architecture). It can play various sound file formats, including WAV.
Audio Tools and Libraries: The ATDM can support various audio tools and libraries such as PulseAudio or ALSA utilities, providing comprehensive control over audio settings and playback.
Using aplay
to Play a Sound File
The aplay
command is a straightforward way to test and play audio files on the ATDM. Here’s how to use it:
Install ALSA Utilities: Ensure that the ALSA utilities are installed on your system. If not, you can install them using the package manager:
Playing a Sound File: Use the
aplay
command to play a WAV file:This command will play the specified sound file through the default audio output device.
Digital I/O
The Digital I/O can be accessed on the command line using the
gpiolib
commands.gpiodetect
reports the available GPIO interfaces, including the i.MX8 GPIO and external GPIO. The results are:gpiochip0 [30200000.gpio] (32 lines)
gpiochip1 [30210000.gpio] (32 lines)
gpiochip2 [30220000.gpio] (32 lines)
gpiochip3 [30230000.gpio] (32 lines)
gpiochip4 [30240000.gpio] (32 lines)
gpiochip5 [3-0020] (16 lines)
gpiochip6 [max31911] (16 lines)
Digital Outputs Overview
The ATDM provides several digital outputs that can be controlled programmatically using the gpioset
command. These outputs are managed through gpiochip5
. Here’s how you can control the digital outputs:
GPIO Chip: The digital outputs are on
gpiochip5
.Control Command: Use the
gpioset
command to set an output high or low.Mapping Table: The physical outputs map to specific bits in
gpiochip5
.
Mapping Between Physical Outputs and Bits
Digital Output 1
0
Digital Output 2
1
Digital Output 3
2
Digital Output 4
3
Digital Output 5
4
Digital Output 6
5
Digital Output 7
10
Digital Output 8
11
Using gpioset
Command
Set Output High: To turn on a digital output.
Example: To turn on Digital Output 1, use:
Set Output Low: To turn off a digital output.
Example: To turn off Digital Output 1, use:
C++ Example
Here is a C++ program that uses the system()
function to call the gpioset
command.
By following these guidelines and using the provided code example, you can effectively control the ATDM's digital outputs, allowing for versatile and programmable output management.
Digital Inputs Overview
The ATDM provides several digital inputs that can be monitored programmatically using the gpioget
command. These inputs are managed through gpiochip6
. Here’s how you can monitor the digital inputs:
GPIO Chip: The digital inputs are on
gpiochip6
.Control Command: Use the
gpioget
command to read the state of an input.Mapping Table: The physical inputs map to specific bits in
gpiochip6
.
Mapping Between Physical Inputs and Bits
Digital Input 1
0
Digital Input 2
1
Digital Input 3
2
Digital Input 4
3
Digital Input 5
4
Digital Input 6
5
Digital Input 7
10
Digital Input 8
11
Using gpioget
Command
Read Input State: To read the state of a digital input.
Example: To read the state of Digital Input 1, use:
C++ Example
Here is a C++ program that uses the system()
function to call the gpioget
command and reads the state of the digital inputs.
By following these guidelines and using the provided code examples, you can effectively monitor the digital inputs on the ATDM, enabling responsive and real-time input management for your application.
Analog Inputs
Analog Inputs Overview
The ATDM provides several analog inputs that can be read programmatically via the file system. These inputs are managed through the Industrial I/O (IIO) subsystem. Here’s how you can monitor the analog inputs:
File System Path: The analog inputs are read from files in the
/sys/bus/iio/devices/iio:device1
directory.Reading Command: Use the
cat
command to read the raw value of an analog input.Channel Mapping: The analog inputs map to specific channels (0-5).
Mapping Between Physical Inputs and Channels
Analog Input 1
0
Analog Input 2
1
Analog Input 3
2
Analog Input 4
3
Analog Input 5
4
Analog Input 6
5
Using cat
Command
Read Input Value: To read the value of an analog input.
Example: To read the value of Analog Input 1 (channel 0), use:
C++ Example
Here is a C++ program that reads the raw value of the analog inputs from the file system.
By following these guidelines and using the provided code examples, you can effectively monitor the analog inputs on the ATDM, enabling precise and real-time input management for your application.
RS485
Install Necessary Tools: Ensure
minicom
is installed for testing serial communication.Check Serial Port: Verify the RS485 serial port is available (typically
/dev/ttyUSB0
or similar).Set Serial Port Parameters: Configure the serial port with the correct settings (adjust parameters as needed).
Enable RS485 Mode: Create and compile a C program to enable RS485 mode.
Compile and run the program:
Connect Devices: Connect the RS485 lines between two devices (e.g., two Verdin modules or a Verdin module and another RS485-enabled device).
Open Minicom: Start
minicom
on the Verdin module.Send and Receive Data: Type and send data in the terminal to verify communication. Use another terminal or device to receive and verify the data.
To read from the other device:
Check Data Transmission: Ensure the data sent from one device is correctly received by the other.
Troubleshoot if Necessary: If communication fails, verify wiring, termination, serial port settings, and RS485 mode configuration.
CAN Channels
Setup and Use CAN and CAN FD on TorizonOS
1. Install CAN Utilities
Ensure CAN utilities are installed. TorizonCore usually comes with these tools, but you might need to install them in your container environment if not present.
2. Load Kernel Modules
Load the necessary kernel modules for CAN and CAN FD.
3. Configure CAN Interface
Configure the CAN interface. Replace can0
with your actual interface name.
4. Configure CAN FD Interface
Configure the CAN FD interface similarly.
5. Testing CAN Communication
Send a CAN Message: Use
cansend
to send a CAN message.Listen for CAN Messages: Use
candump
to listen for incoming CAN messages.
6. Testing CAN FD Communication
Send a CAN FD Message: Use
cansend
to send a CAN FD message.Listen for CAN FD Messages: Use
candump
to listen for incoming CAN FD messages.
7. Using CAN and CAN FD in a Torizon Container
Create and Configure a Torizon Container: Create a Docker container with CAN utilities installed.
Run the Container with CAN Support: When starting the container, pass the necessary device files and network settings to access the CAN interface.
Inside the Container: Use
cansend
andcandump
utilities inside the container as you would on the host.
Now you can start using applications that may connect to the CAN Network, or simply use the can-utils for testing.
For programming a Linux application in C/C++, you can use the SocketCAN API. There is also a wrapper for it in Python.
Last updated