Electronic – Sending data from RN-171 in adhoc mode

iphonewifi

First, I'd like to note that I'm a software engineer by profession and haven't had anything but trivial experience in interfacing with hardware.

With that said, I'm looking at getting a prototype going with an electrical engineer.

Basically, we have an RN-171 WiFi module that we need to communicate with an iPhone.

I'm not sure why the exact module was chosen as it's made to connect to WiFi network and GET and POST information to it. We want to use it differently however, we want it to broadcast a network in Adhoc mode and connect an iPhone to it which was trivial.

The next step is, once the iPhone is connected, we need to be able to retrieve data from the device. The device is hooked up to a microprocessor which is hooked up to some monitoring devices. The idea is, the device saves monitoring data to a memory card, a user comes along and wants to check the logs, so he connects to the Adhoc network using his iPhone, sends a request to the RN-171 which then somehow sends a message to the microprocessor asking it to send through the log data to the iPhone over WiFi (can't assume there will be any other device other than the iPhone and can't assume a 3G network is available).

The thing is, the device isn't programmable as far as I can tell so I have no idea how I can achieve that. To be honest, I don't care how the RN-171 communicates to the iPhone.

I noticed that port 80 was open so I tried to access the device through the web browser but all I'm getting is an empty screen and I don't think there's any way to get it to display any info (although it would be good if I could…).

The device also interfaces over port 2000 so I connected to it via that port using telnet and could see messages from my laptop connected to the device (which I'm testing with) but I could figure out, again, how to send it to send messages to the device.

I did realize, however, that there is a command set comm remote <message> where message can be a 32 character long string of choice. So far that looks to be my best way to communicate to the device (assuming ios can talk to the device over port 20) that I've found which is pretty sad. Basically, I'll have to connect and disconnect from the port, each time receiving up to 32 length of character data which sounds ridiculous.

So yeah, it may be quite obvious that I don't have much idea where I'm heading so any information will be very appreciated as to where I can go from here and what my options are using this device.

EDIT: The issue is how to communicate from the device to the iPhone. The remote message I mentioned is shown up when a TCP connection is established to the device. For example, if I set the message to TEST, when I telnet to the device over port 2000, I'll get back TEST. Obviously this isn't meant to be a way for the device to communicate data to a device connected in Adhoc mode.

The ideal scenario is when the connected device makes a HTTP request to the WiFi device, I get back some custom infomation (for example a table of data). If not, then any other method of communication is okay. Basically I want to know how to communicate information from the WiFi device to the iPhone when the iPhone requests information.

Best Answer

I noticed that port 80 was open

On an RN-171? This module supports HTTP client mode only and has no HTTP server, unless we talk about custom firmware.

somehow sends a message to the microprocessor

Sounds like you really need to read the (WiFly) manual again. The RN-171 has a UART interface, and you can use it to talk through the WLAN module from our microcontroller to your iPhone, in both ways. In short, you open a tcp port on your phone and use it like an oldschool serial port that is connected to your MCU.