| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		
			mayur.k.vadukul
 
 
  Joined: 07 Jul 2022 Posts: 42
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				| ESP8266 - PIC setting WiFi Setup | 
			 
			
				 Posted: Mon Jan 08, 2024 7:15 am     | 
				     | 
			 
			
				
  | 
			 
			
				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: 19967
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Mon Jan 08, 2024 7:57 am     | 
				     | 
			 
			
				
  | 
			 
			
				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: 42
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Mon Jan 08, 2024 8:00 am     | 
				     | 
			 
			
				
  | 
			 
			
				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: 19967
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Mon Jan 08, 2024 8:25 am     | 
				     | 
			 
			
				
  | 
			 
			
				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: 42
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Mon Jan 08, 2024 8:46 am     | 
				     | 
			 
			
				
  | 
			 
			
				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: 19967
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Mon Jan 08, 2024 10:08 am     | 
				     | 
			 
			
				
  | 
			 
			
				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: 1074 Location: Panama 
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Tue Jan 16, 2024 4:11 pm     | 
				     | 
			 
			
				
  | 
			 
			
				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 | 
			 
		  | 
	
	
		  | 
	
	
		 |