-->
Page 1 of 2

Newbie need advice

PostPosted: Mon Jun 08, 2015 1:48 pm
by malc-c
First post, and I'm at a loss !

I currently have a project that communicates to a PC application via serial. When launched the applications scans the ports by sending out a character, which when detected by the PIC micro the PIC responds by sending back a charter,

Code: Select allcoms:
HSERIN [nTest]
    SELECT CASE nTest
    CASE "C"                    ; if C then application checking for controller
    goto respond
    CASE "Q"                    ; if Q then send data to PC
    Goto Term_TX
    CASE "S"                    ; if S then receive data from PC
    goto Term_RX


Once the main window opens S is sent by the application and in return a stream of data which is sequentially filled into boxes on the PC app is transmitted.
Code: Select allTerm_TX:

Hserout [DEC3 Temperatures(0)]
Hserout [DEC3 Temperatures(1)]
Hserout [DEC3 Temperatures(2)]
Hserout [DEC3 Temperatures(3)]

HSEROUT [dec3 normtemp[0]]
HSEROUT [dec3 normtemp[1]]
HSEROUT [dec3 normtemp[2]]
HSEROUT [dec3 normtemp[3]]

etc.... etc....


A few of these boxes allow me to change the values and then update the PIC by sending back a complete data stream. However I've just stumbled across the ESP8266 modules and thought that this would be an ideal way of updating the project to give access over the net rather than tethered to the PC.

I would rather keep the PC application for now rather than have a web page to view and change data, but would wonder how to implement this. Its ages since I had any dealings with AT commands (14400 fax modem days :shock: ) but I'm assuming that data can be sent and received in a similar may via these AT commands and or this "operating system" that sits on the ESP chip ???

Hope someone can point me in the right direction ?

Cheers

Malcolm

Re: Newbie need advice

PostPosted: Mon Jun 08, 2015 3:15 pm
by cal
I didn't tried it but maybe this is easier: https://github.com/beckdac/ESP8266-transparent-bridge

Just my € 0,02

Cal

Re: Newbie need advice

PostPosted: Tue Jun 09, 2015 4:50 pm
by malc-c
many thanks for the link... It sounds a good solution.

A lot of the info went right over my head, so I may well be back asking lots of questions once the module arrives and I have time to play :)

Re: Newbie need advice

PostPosted: Wed Jun 10, 2015 10:37 am
by malc-c
Ok my ESP8266 board arrived from E-bay this morning. I'm doing some original testing and I have no idea why I get the following issues. I know the device is working as it's broadcasting an open network which can be connected to on my mobile phone. It gives me a 255.255.255.0 subnet mask, ip of 192.168.4.101 and gateway of 192.168.4.1

I have the connected as follows:
Vcc to +3.3v
GND to ground
TX to RX on a FTDI 232 USB board
RX to TX on a FTDI 232 board (via 1K resistor, with a 2K resistor to GND ie simple voltage divider)
CH-PD to 3.3v (also tried via 10K resistor)
GND on the FTDI to GND on the psu

When the serial terminal is opened and the device connected at 9600 baud sending AT to the device returns back AT and OK. Sending AT+RST responds with a line of garbage and then the vendor web address and version number and then READY.

Sending AT+CWMODE=2 or AT+CWMODE=3 results in the command being echoed back and the ERROR. I get the same ERROR response to sending CWJAP, CWLAP etc.... any ideas ????

Basically I want to put it into device mode so I can connect it to my existing router. I assume I just need to send AT+CWJAP=“you ssid”, “password” and it should connect ??

Any advice would be welcome