Serial communications using the USB connection

Hi,

I’m developing a hardware / software solution and I need to transfer some information from a external device to the mobile. I know you can receive data using the wifi / bluetooth channel but, the “other” device is very very old and only uses a RS232 port.

Of course I can use Android SDK to do that but I’m more quick and efficient working on Corona.

I take a look to the sockets documentation looking for any reference but I have not find anything talking about it.

I’m sure it can be done using lua (http://www.hackinglab.org/lua/luasource.html) but not sure how to implement on Corona SDK. 

Any help is welcome! Thanks!

Josep Alemany

How are you attaching the serial device to the android device? As far as I’m aware most android devices don’t have serial ports (or even host mode USB ports), so I’m curious how you’re getting around that issue.

All that being said there are serial port servers that expose a serial connection over tcp/ip. That would let you use the socket implementation to connect to it.

Assuming that doesn’t work for you, and you’ve found a device that has a serial port yo could use enterprise or coronacards to use the normal android sdk to get at what you want.

You are right, there is not Android devices with this old connectors but I do it with a simple adaptor to micro USB:

http://www.alibaba.com/showroom/rs232-to-micro-usb.html

I’m talking about a OLD machine… of course do not have any server and tcp/ip will be a incredible fantasy :wink: Just for this reason it sends the information using a RS232 (the top technology of those days!).

If I have to use the enterprise only to finally use the Android SDK calls, there is no reason to use Corona SDK… I can do it directly using Android SDK! :(((

Any suggestion?

What android device are you using that those adapters will work? Most ( as far as I know) device do not support USB host mode, so even if the connector is right to plug into the usb micro port it wont actually be detected.

The serial port servers that I’m talking about are like these things

http://www.perle.com/products/RS232-to-Ethernet.shtml

https://www.digi.com/products/serialservers/digionesp

http://gridconnect.com/usb-to-serial/serial-to-ethernet.html

Using one of those would put your rs232 device on your LAN, which would let you access it via telnet/ssh etc. Which has the potential of being much simpler than dealing with getting your android device(s) communicating via a serial port.

How are you attaching the serial device to the android device? As far as I’m aware most android devices don’t have serial ports (or even host mode USB ports), so I’m curious how you’re getting around that issue.

All that being said there are serial port servers that expose a serial connection over tcp/ip. That would let you use the socket implementation to connect to it.

Assuming that doesn’t work for you, and you’ve found a device that has a serial port yo could use enterprise or coronacards to use the normal android sdk to get at what you want.

You are right, there is not Android devices with this old connectors but I do it with a simple adaptor to micro USB:

http://www.alibaba.com/showroom/rs232-to-micro-usb.html

I’m talking about a OLD machine… of course do not have any server and tcp/ip will be a incredible fantasy :wink: Just for this reason it sends the information using a RS232 (the top technology of those days!).

If I have to use the enterprise only to finally use the Android SDK calls, there is no reason to use Corona SDK… I can do it directly using Android SDK! :(((

Any suggestion?

What android device are you using that those adapters will work? Most ( as far as I know) device do not support USB host mode, so even if the connector is right to plug into the usb micro port it wont actually be detected.

The serial port servers that I’m talking about are like these things

http://www.perle.com/products/RS232-to-Ethernet.shtml

https://www.digi.com/products/serialservers/digionesp

http://gridconnect.com/usb-to-serial/serial-to-ethernet.html

Using one of those would put your rs232 device on your LAN, which would let you access it via telnet/ssh etc. Which has the potential of being much simpler than dealing with getting your android device(s) communicating via a serial port.

hi, jalemanyf

i’m kristian, i have problem with coronasdk connect with arduino kit. i was try with native code with eclipse it is dificult. can you give me sample code for connection coronaSDK to arduino

Hi Kristian,

I have solved my problem connecting the serial to a Raspberry pi. Then I publish the information like a RESTFull web service and this is easy to access with Corona.

Could this help you? or you have to do it with Arduino?

Best Ragards,

Josep Alemany

thank for your information. :slight_smile:

Best Ragards,

 

kristian maulana

If you explains me a little bit what you wanna do, I can try to help more… please, feel free to contact me and do it together.

Best Regards,

Josep Alemany

I have sometype arduino. Model I just want try connection corona’s with arsonists. Be side I was try corona’s is simply to create you what I want and I try to connect with arduino bord

maybe i wanna make first project like flipflop led with coronaSDK for mobile device for controled lamp with arduino board. i’ve seen some code in github but still difficult for translate code with c language this link i was see in github https://github.com/biomood/LuaSerial

hi, jalemanyf

i’m kristian, i have problem with coronasdk connect with arduino kit. i was try with native code with eclipse it is dificult. can you give me sample code for connection coronaSDK to arduino

Hi Kristian,

I have solved my problem connecting the serial to a Raspberry pi. Then I publish the information like a RESTFull web service and this is easy to access with Corona.

Could this help you? or you have to do it with Arduino?

Best Ragards,

Josep Alemany

thank for your information. :slight_smile:

Best Ragards,

 

kristian maulana

If you explains me a little bit what you wanna do, I can try to help more… please, feel free to contact me and do it together.

Best Regards,

Josep Alemany

I have sometype arduino. Model I just want try connection corona’s with arsonists. Be side I was try corona’s is simply to create you what I want and I try to connect with arduino bord

maybe i wanna make first project like flipflop led with coronaSDK for mobile device for controled lamp with arduino board. i’ve seen some code in github but still difficult for translate code with c language this link i was see in github https://github.com/biomood/LuaSerial