{"id":7906,"date":"2015-06-12T13:58:03","date_gmt":"2015-06-12T18:58:03","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=7906"},"modified":"2020-07-06T09:32:30","modified_gmt":"2020-07-06T14:32:30","slug":"mlinux-configure-and-use-hardware-io","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/mlinux\/using-mlinux\/mlinux-configure-and-use-hardware-io\/","title":{"rendered":"Hardware I\/O Usage"},"content":{"rendered":"<h3>Default Console Login Credentials<\/h3>\n<ul>\n<li>Username: <code>root<\/code><\/li>\n<li>Password: <code>root<\/code><\/li>\n<\/ul>\n<h3>Serial Debug Port<\/h3>\n<p><em>This section applies to MTCDT-xx-210L only.<\/em><\/p>\n<p>The micro USB connector on the front of the device behind the removable panel provides a USB serial debug port. The debug port provides access to the bootloader (U-boot) and the Linux system console.<\/p>\n<ul>\n<li>Baud rate: 115,200<\/li>\n<li>Data: 8 bit<\/li>\n<li>Parity: none<\/li>\n<li>Stop: 1 bit<\/li>\n<li>Flow control: none<\/li>\n<\/ul>\n<p>If the USB port isn&#8217;t recognized on your computer, download and install this driver:\u00a0<a href=\"https:\/\/www.exar.com\/content\/document.ashx?id=1596\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.exar.com\/content\/document.ashx?id=1596<\/a><\/p>\n<h3>Ethernet<\/h3>\n<p>The built-in ethernet port is a 10\/100 Mbps interface. Network configuration is defined in<br \/>\n<code>\/etc\/network\/interfaces<\/code>.<\/p>\n<p><strong>Defaults:<\/strong><\/p>\n<ul>\n<li>IP address: <code>192.168.2.1<\/code><\/li>\n<li>Subnet mask: <code>255.255.255.0<\/code><code><\/code><\/li>\n<\/ul>\n<p>To change the static IP, change the <code>address<\/code> and <code>netmask<\/code> fields in\u00c2\u00a0<code>\/etc\/network\/interfaces<\/code> (use vi or nano). To apply changes, either <code>reboot<\/code> the device or issue: <code>ifdown eth0; ifup eth0<\/code>.<\/p>\n<p>To enable the DHCP server with default settings, issue: <code>mlinux-dhcpd start<\/code>. Configure the dhcp server by editing <code>\/etc\/udhcpd.conf<\/code>. You can also issue <code>mlinux-dhcpd stop<\/code> or <code>mlinux-dhcpd restart<\/code>.<\/p>\n<h3>Cellular<\/h3>\n<p>Cellular data\/Internet access is provided by the PPP software.<\/p>\n<p>To set up an H5 radio cellular data connection using default options:<\/p>\n<pre class=\"brush:shell\"># Set \"APN\" to the APN for your cellular provider\r\n$ mlinux-set-apn APN\r\n\r\n# Dial the connection (using \/etc\/ppp\/peers\/gsm config)\r\n$ pppd call gsm\r\n\r\n# Verify ppp0 is up\r\n$ ifconfig ppp0\r\nppp0      Link encap:Point-to-Point Protocol  \r\n          inet addr:33.140.12.18  P-t-P:33.140.12.18  Mask:255.255.255.255\r\n          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1\r\n          RX packets:7 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:3 \r\n          RX bytes:106 (106.0 B)  TX bytes:145 (145.0 B)<\/pre>\n<p>PPP daemon options are configurable in \/etc\/ppp\/options and in peers files: <code>\/etc\/ppp\/peers\/gsm<\/code><\/p>\n<p>To reset the cellular radio in the case that the radio is unresponsive to AT commands:<br \/>\n<code>$ mts-io-sysfs store radio-reset 0<\/code><\/p>\n<p>The <a href='https:\/\/www.multitech.net\/developer\/software\/mlinux\/using-mlinux\/utilities\/radio-query-usage\/' title='radio-query Usage'>radio-query<\/a> and <a href='https:\/\/www.multitech.net\/developer\/software\/mlinux\/using-mlinux\/utilities\/radio-cmd-usage\/' title='radio-cmd Usage'>radio-cmd<\/a> scripts can be used to communicate with the radio using these soft links to the radio&#8217;s USB ports: <code>\/dev\/modem_at0<\/code> and <code>\/dev\/modem_at1<\/code>.<\/p>\n<h3>LEDs<\/h3>\n<h4>MTCDT<\/h4>\n<p>There are five software-controlled LEDs on the MTCDT hardware:<\/p>\n<ul>\n<li>led-status &#8211; default: status (solid during boot, flashes while running)<\/li>\n<li>led-a\u00a0 &#8211; default: always off<\/li>\n<li>led-b\u00a0 &#8211; default: always off<\/li>\n<li>led-c &#8211; default: always off<\/li>\n<li>led-d\u00a0 &#8211; default: always off<\/li>\n<\/ul>\n<h4>MTCAP<\/h4>\n<ul>\n<li>STATUS &#8211; default: blinks when operating system is fully loaded.<\/li>\n<li>LORA\u00a0 &#8211; default: lights when LoRa software is active.<\/li>\n<li>CELL\u00a0 &#8211; default: lights when there is power to the cellular radio. Cellular models only.<\/li>\n<li>WIFI &#8211; default: always off Wi-Fi models only.<\/li>\n<li>Ethernet Link\u00a0 &#8211; default: always off<\/li>\n<\/ul>\n<h4>MTCDT and MTCAP<\/h4>\n<p><strong>LED control using <code>mts-io<\/code> provides simple on\/off functionality and gives the convenience of using the <code>mts-io-sysfs<\/code> script.<\/strong><\/p>\n<p><em>Examples<\/em><\/p>\n<ul>\n<li>Turn led-a on:\n<pre class=\"brush:shell\">$ mts-io-sysfs store led-a 1<\/pre>\n<\/li>\n<li>Turn led-a off:\n<pre class=\"brush:shell\">$ mts-io-sysfs store led-a 0<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>LED control using the linux <code>leds-gpio<\/code> driver gives advanced functionality in the form of triggers. Options:<\/strong><\/p>\n<ul>\n<li><code>none<\/code>: disable trigger (in order to use <code>mts-io<\/code>)<\/li>\n<li><code>nand-disk<\/code>: NAND flash activity<\/li>\n<li><code>timer<\/code>: custom LED flash timing<\/li>\n<li><code>heartbeat<\/code>: default for led-status<\/li>\n<li><code>default-on<\/code>: always on<\/li>\n<li><code>mmc0<\/code>: SD card activity<\/li>\n<\/ul>\n<p><em>Examples<\/em><\/p>\n<ul>\n<li>Show current led-status trigger:\n<pre class=\"brush:shell\">$ cat \/sys\/class\/leds\/led-status\/trigger<\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>Change led-status to NAND flash activity:\n<pre class=\"brush:shell\">$ echo \"nand-disk\" &gt; \/sys\/class\/leds\/led-status\/trigger<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>USB ports<\/h3>\n<p><em>This section applies to MTCDT-xx-210L only.<\/em><\/p>\n<h4>Host port<\/h4>\n<p>This port is a USB 2.0 high speed port that functions as a host to any USB device, such as a flash drive, printer, etc. Linux driver support is required for any device attached to this port.<\/p>\n<h4>Device port<\/h4>\n<p>This port functions as a device connected to a host, such as your development PC. The USB gadget set of Linux drivers provides functionality for connected devices.<\/p>\n<p>By default, this port is configured as a USB serial port (g_serial driver) with a serial login console that functions like the debug port.<\/p>\n<p>This port&#8217;s functions can be customized as needed. For example, you can have the\u00a0Conduit<sup>\u00ae<\/sup> show up as a mass storage device on your PC. To change the gadget driver loaded on boot, edit <code>\/etc\/default\/usb-gadget-mode<\/code> and change the <code>USB_MODE<\/code> variable. For USB_MODE available options, see<code> \/usr\/bin\/usb-gadget<\/code> contents. To disable the serial console, edit <code>\/etc\/inittab<\/code> and comment out or delete the line starting <code>getty<\/code> on <code>ttyGS0<\/code>.<\/p>\n<p>&nbsp;<\/p>\n<h3>Reset button<\/h3>\n<p>The reset button on the MTCDT hardware interfaces to the <a href='https:\/\/www.multitech.net\/developer\/software\/mlinux\/using-mlinux\/utilities\/io-control-using-mts-io\/' title='I\/O Control Using mts-io'>mts-io utility<\/a>. A reset button handler named <code>reset-handler<\/code> installs and starts on boot.<\/p>\n<p>Default reset-handler behavior:<\/p>\n<ul>\n<li>Short button press (&lt; 5 seconds): perform soft reboot<\/li>\n<li>Long button press (&gt;= 5 seconds): reboot and restore default settings<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>mts-io attributes<\/p>\n<ul>\n<li><code>reset<\/code>: show current state of reset button\n<pre class=\"brush:shell\">$ mts-io-sysfs show reset<\/pre>\n<\/li>\n<li><code>reset-monitor<\/code>: show\/set configuration of PID to signal on button press\n<pre class=\"brush:shell\">$ mts-io-sysfs show reset-monitor<\/pre>\n<pre class=\"brush:shell\">$ mts-io-sysfs store reset-monitor \u00e2\ufffd\ufffd500 10 12 1\u00e2\ufffd\ufffd<\/pre>\n<p><em>PID=500, send SIGUSR1 (signal 10) on short press, send SIGHUP (signal 1) on extra long press<\/em><\/li>\n<li><code>reset-monitor-intervals<\/code>: show\/set the button press durations used by reset-monitor\n<pre class=\"brush:shell\">$ mts-io-sysfs store reset-monitor-intervals \u00e2\ufffd\ufffd5 30\u00e2\ufffd\ufffd<\/pre>\n<p><em>Short press: &lt; 5 seconds, long press: &lt; 30 seconds, extra long press: &gt;= 30 seconds<\/em><\/li>\n<li><code>Reset-handler<\/code> uses the <code>reset-monitor<\/code> and <code>reset-monitor-intervals<\/code> attributes to configure <code>mts-io <\/code>and then waits for signals generated by a button press.<\/li>\n<\/ul>\n<p>To customize reset button behavior, provide a custom version of reset-handler or disable it and install your own handler. See <code>\/usr\/sbin\/reset-handler<\/code> for reference. To disable reset-handler from starting on boot, modify <code>\/etc\/default\/reset-handler<\/code> and set <code>ENABLED=\u00e2\ufffd\ufffdno\u00e2\ufffd\ufffd<\/code>.<\/p>\n<p>&nbsp;<\/p>\n<h3>Micro-SD Card<\/h3>\n<p><em>This section applies to MTCDT-xx-210L only.<\/em><\/p>\n<p>Cards inserted into the micro-SD slot are auto mounted at <code>\/media\/card<\/code> using device <code>\/dev\/mmcblk0p1<\/code> (first partition on the device). Linux Ext2\/3\/4 and MSFAT file systems are supported by default. To change the mounting behavior, see <code>\/etc\/fstab<\/code>.<\/p>\n<ul>\n<li>By default,\u00a0mLinux<sup>\u2122<\/sup> mounts the SD card using the <code>sync<\/code> mount option. This flushes all writes to the physical card immediately. This can increase write times, but allows the writing application to know that the data is on the card when it is done writing. It also reduces the chances for filesystem corruption if the SD card is removed from the slot without unmounting it.<\/li>\n<li>To improve write performance, the SD card may be mounted with the <code>async<\/code> option instead. The performance cost of the sync mount option varies from card to card. Some cards gain a very large increase in throughput by using <code>async<\/code> instead of <code>sync<\/code> when mounting.<\/li>\n<li>To use the <code>async<\/code> mount option, modify the following line in<code> \/etc\/fstab<\/code> and remove &#8216;<code>, sync <\/code>&#8216;\n<pre class=\"brush:shell\">\/dev\/mmcblk0p1 \/media\/card auto defaults,sync,noauto 0 0<\/pre>\n<\/li>\n<li>After modification, the line should read:\n<pre class=\"brush:shell\">\/dev\/mmcblk0p1 \/media\/card auto defaults,noauto 0 0<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>Temperature Sensor<\/h3>\n<p>The MTCDT hardware includes an on-board TMP102 temperature sensor, which is accessed via the <code>hwmon sysfs<\/code> interface. Units are in millidegrees Celsius<\/p>\n<p>Read current temperature:<\/p>\n<pre class=\"brush:shell\">cat \/sys\/class\/hwmon\/hwmon0\/temp1_input<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Default Console Login Credentials Username: root Password: root Serial Debug Port This section applies to MTCDT-xx-210L only. The micro USB connector on the front of the device behind the removable panel provides a USB serial debug port. The debug port provides access to the bootloader (U-boot) and the Linux system console. Baud rate: 115,200 Data: [&hellip;]<\/p>\n","protected":false},"author":537,"featured_media":0,"parent":9184,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-7906","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/7906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/537"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=7906"}],"version-history":[{"count":54,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/7906\/revisions"}],"predecessor-version":[{"id":8026,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/7906\/revisions\/8026"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/9184"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=7906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}