Category Archives: Lantronix

Lantronix Analog Sender

Here’s a short Wiring/Arduino program that waits for a connection to the microcontroller via a Lantronix device, and sends out an analog reading when it’s got a connection. The Lantronix device is in connectMode D4, and the TX is connected … Continue reading

Posted in arduino/wiring, Lantronix | Tagged | Leave a comment

Sensorbase datalogger

Sensorbase.org is an open data repository run by the Center for Embedded Networked Sensing at UCLA. It’s a database of sensor databases. You can upload datasets to it, and you can browse other datasets as well. If you’ve never set … Continue reading

Posted in arduino/wiring, Lantronix, PHP | Tagged , , , , , , , | 2 Comments

Finding a Lantronix Device on a Subnet

Any Java app that receives TCP connections will be able to pull out the IP address of the device connecting to it.Processing app:If your router doesn’t disclose the IP table, there are at least five ways you can discover the Xport’s IP; one PC-dependent, one Mac-dependent, and three platform independent.Mac-dependent: download IPNetMonitorX and use it to ping all devices on your subnet…. This program uses the Hypermedia UDP library available at http://hypermedia.loeil.org/processing/ by Tom Igoe Created 18 April 2006 */// import UDP libraryimport hypermedia.net.*;UDP udp; // define the UDP objectint queryPort = 30718; // the port number for the device queryString broadcastIpAddress = “128.122.151.255”; // fill in IP address herevoid setup() { // create a new connection to listen for // UDP datagrams on query port udp = new UDP(this, queryPort);// listen for incoming packets: udp.listen( true );}//process eventsvoid draw() { // twiddle your thumbs.
Continue reading

Posted in Lantronix | Comments Off on Finding a Lantronix Device on a Subnet

Lantronix Test Program

This is a very simple program to test the serial-to-ethernet connections of a Lantronix device connected to an Arduino or Wiring board./* Lantronix Test Sketch This sketch is written for an Arduino connected to a Lantronix device. It simply says “hello” to any byte received in the serial port.
Continue reading

Posted in arduino/wiring, Lantronix | Comments Off on Lantronix Test Program

Web Scraping using a Microcontroller

This program connects a Wiring or Arduino module to the internet through a Lantronix serial-to-ethernet converter (Xport, WiPort, or Micro)…. When the web page comes back, it parses the page for < and > symbols, and takes the string between them. Continue reading

Posted in arduino/wiring, Lantronix, PHP | Comments Off on Web Scraping using a Microcontroller

Xport to SQL

This program connects a microcontroller to a mySQL database via a Lantronix Xport and a PHP script.The PHP script it uses is the SQL_datalog.php script in the Network Data Logging Suite.
Continue reading

Posted in Lantronix, PicBasic Pro | Comments Off on Xport to SQL

Sending UDP Datagrams to and from a Cobox, Xport, or WiPort

In this configuration, you have to compose your own outgoing datagrams, as follows:From the serial side, you send: (Start of transmission byte)(Destination IP byte 1)(Destination IP byte 2)(Destination IP byte 3)(Destination IP byte 4)(Number of data bytes (a two-byte value))(data bytes, highest to lowest)For example, to send the string “1023” to the address 192.168.0.20, you’d send the following into the serial port of the Cobox (these are the raw values of the bytes, in decimal form):2 192 168 0 20 0 4 49 48 50 51The device at 192.168.0.20 would receive the ASCII string “1023”.To send to a Cobox, you just send a datagram as you normally would…. For example, if you sent the string “AAAA” to the cobox, from IP address 192.168.0.30, then what you’d see out the serial port would look like this (again, these are the raw values of the bytes, in decimal form):2 192 168 0 30 0 4 65 65 65 65This means that in order to get the data in the packet, you have to discard the header.
Continue reading

Posted in Lantronix | Comments Off on Sending UDP Datagrams to and from a Cobox, Xport, or WiPort

Lantronix Device Connection with serial feedback

The Lantronix Device has to have its connect mode set to verbose, so that it will send ASCII N when not connected, ASCII D when disconnecting, and ASCII C when a connection is made.’ connection to the Lantronix device through a hex inverter:TX var portd.0RX var portd.1′ serial to PC for debugging:debugTX var portc.6′ some indicator LED’s for later use:yellowLED var portb.2greenLED var portb.7redLED var portb.3′ two switches:switch1 var portb.0switch2 var portb.1′ data coming in the serial port:inbyte var byte’ set the switch pins to input mode:input switch1input switch2′ clear all variables:clearmain: ‘ the Lantronix device is set to connect mode D5, meaning that ‘ it will return a byte to the PIC to indicate ‘ the connection status.
Continue reading

Posted in Lantronix, PicBasic Pro | Comments Off on Lantronix Device Connection with serial feedback