CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ESP8266 - PIC setting WiFi Setup

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mayur.k.vadukul



Joined: 07 Jul 2022
Posts: 40

View user's profile Send private message

ESP8266 - PIC setting WiFi Setup
PostPosted: Mon Jan 08, 2024 7:15 am     Reply with quote

Hi,
I am new to this but I need some pointers.
I have ESP12 module which I will be using for WiFi connectivity for my PIC18 based board.
I can handle the ESP12 using AT Commands.
However, I have a question as to providing WiFi Setup.
1. I will place the ESP8266 module in the SoftAP+Station mode in the beginning.
2. User will connect to the SoftAP on their phone.
3. I will provide the IP address of the ESP12 in the manual, so the user can open that webpage on their phone browser and set up the available WiFi. Once the WiFi is established, the webpage will show it is connected tot he WiFi.

I do not know how to perform Step 3. Any help or guidance will be helpful.
_________________
MVadukul
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Mon Jan 08, 2024 7:57 am     Reply with quote

What you describe won't work.
The default IP, is a local IP. Can't be used to talk to the chip except on the
local network. You have to send AT+CWJAP="your_network_name","your_wifi_network_password"
to make it join your local network, and then send an 'AT+CIFSR' command
to the unit, and it will then reply with the IP address it is using. It is this
you have to give to other people.

Forget trying to get the webpage working for now. Just make sure you
can send commands and read the replies. Only once this is working start
thinking about the webpage.
mayur.k.vadukul



Joined: 07 Jul 2022
Posts: 40

View user's profile Send private message

PostPosted: Mon Jan 08, 2024 8:00 am     Reply with quote

So is it not possible to create a system which has its own WiFi network and once the user connects to it then they can talk to each other, whereby the user can connect it to their own WiFi which has internet connection?
_________________
MVadukul
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Mon Jan 08, 2024 8:25 am     Reply with quote

The ESP can be programmed to be an access point. The connection
details for this WiFi network will be what you setup. Not any 'default'.
You will need to provide the SSID for the network, and the password
for this. You will probably need to program it to provide a server as
well to do what you are describing.
The same comments really apply. Start by just connecting the ESP using
a USB to serial stick on your PC. You can then run terminal software and
try sending it basic commands. Work through some of the online tutorials
first. "getting started with the ESP8266' is a well known one.
You need to learn how the commands work and what they can do, before
even starting to think about coding with a PIC.
mayur.k.vadukul



Joined: 07 Jul 2022
Posts: 40

View user's profile Send private message

PostPosted: Mon Jan 08, 2024 8:46 am     Reply with quote

I should have been clearer a bit I suppose.
1. I have connected PC to ESP module
2. I have used necessary AT commands to place the module in SoftAP (Access Point) + Station Mode - AT+CWMODE = 3
3. I then set up the WiFi Username & Password for its own network as :-
AT+CWSAP =
4. I can connect the Mobile with the network of ESP.
5. I then for the application I want to use, connected the ESP using PC to the WiFi network with internet at my place. and performed some GET & POST commands I need for the project.

The thing which I do not know as to how to interface server mode with PIC micro and in particular setting up page such that user can place credentials of their network which my micro can obtain?

I am sorry if I have been unclear earlier.

Thank you for your help.
_________________
MVadukul
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Mon Jan 08, 2024 10:08 am     Reply with quote

Seriously, that is programming.
All of the control stuff just uses AT commands. Connecting is easy, the
serial is just logic level serial you can connect directly to a PIC _provided
you use a 3.3v PIC_. You need to use your PC setup, and work out how
you would do it from the PC, and then program that into a suitable PIC.
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Tue Jan 16, 2024 4:11 pm     Reply with quote

put the ESP in server mode.
get the PIC to listen for the requests.
handle the request accordingly via the AT commands and parsing in your PIC.
reply to request with HTML code saved in program memory or eeprom.
a single reply page has to be under 2048 bytes.
close connections accordingly
curse at your browser for requesting FAVICON... make code to handle that.

this is a proyect... requires reading datasheets and the AT commands manual.

if you can printf() and strstr(), you now know all that is needed from CCS to get this done.. the rest is in the ESP AT command manual.
_________________
CCS PCM 5.078 & CCS PCH 5.093
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group