Please reference the general Lua interface documentation here: http://www.eluaproject.net/doc/v0.9/en_refman_gen.html
In the realm of binary messaging, here's an all-encompassing solution that shows how to pack and transmit binary.
The first thing we are going to run is a quick "in memory" function that makes converting from something easy to enter on the console (ASCII) hex characters to binary. One binary byte (8 bits) is represented by 2 hex bytes (also 8 bits). This in-memory function will make it easy to enter pairs of hex characters to convert to binary.
In your application, you can take a binary string and parse it out to the appropriate hex characters.
Each command must be less than 100 characters, so let's create some strings that are about 70 characters. Then we will take 48 hex bytes and convert them to 24 binary bytes, and append them to a "tx" variable.
Remember the maximum binary MO payload for the satellite modem is 340 bytes.
Last step is actually transmitting this "tx" variable with a simple "iridium.transmit(tx)"
function hex2bin(str) a='' for c in str:gmatch".." do a=a..string.char(tonumber(c,16)) end return a end
First up is a common item which is how the device is wired, as the outputs are not “driven”, they are “relay” outputs. When the output is active, it sinks current to ground, and when not active, the pin is high Z (but not high voltage). To use the output pin as a high/low IE VCC/GND output, you would wire a pullup resistor on the output.
The MCG-101 works in the general range of WiFi, which is ~50 feet. The MCG-101 functions like a WiFi router at home. As long as the device is not in a bunker type building and as long as the antenna outside is unobstructed and in direct line of sight to the Iridium constellation, connectivity is possible within that give or take 50-foot radius to the device.