- 06/10/2019 at 20:42 #5918
Hello! I’m very new to this type of project: Web-based control and monitoring with pic microcontroller. There are some lines in that project make me confuse.
In SPI_Ethernet_UserTCP function has these lines:
if(!memcmp(getRequest+6,"TA",2))RD0_bit = ~ RD0_bit;
else if(!memcmp(getRequest+6,"TB",2))RD1_bit = ~ RD1_bit;
From what I know: If 2 characters starting at index 6 are “TA” or “TB” => toggle Relay A or Relay B.
My noob question is Why is index 6? Where that come from?
- 11/11/2019 at 01:03 #5933
If Relay A is pressed, the web browser will send the following command to the PIC:
GET /?TA = TOGGLE + RELAY + A
‘TA’ here starts at index 6.
- 13/11/2019 at 20:29 #5935
Thanks for your reply sir. I have one more question. Is it possible to public my IP address so that other devices ( like smartphone with 3G/4G) can access it and control relay? I heard that Dynamic DNS can solve the problem but still I have no idea.
- 13/11/2019 at 22:55 #5936
You can use the SPI_Ethernet_confNetwork() to configure the subnet mask, gateway and DNS server address.
The rest is settings in your router but setting up the NAT.
You can Google: “How to access local ip from outside network” to learn more.
- 14/11/2019 at 21:24 #5937
Thank you. I have done some research. In NAT port, I saw 2 method from now. There are DMZ and Port Forwarding. So both methods are fine?
- 14/11/2019 at 22:17 #5938
Use the one that works for you.
This is computer networking and it’s got nothing to do with microcontroller programming.
- 19/11/2019 at 17:50 #5942
Sorry for bothering you with serie of questions. Now if I want to store my webpage on cloud server (webpage is still the one you used in tutorial), what will change in the code? Thank you
- 19/11/2019 at 20:00 #5943
Your question does not make sense. If you want to store the webpage in the cloud then it simple, store it in the cloud, you don’t need a microcontroller for that. Just use any cloud services and upload your webpage, you will be able to access it everywhere in the world.
And again, this is not a microcontroller question, you can’t use our code in this scenario.
If you need to access your webpage stored in cloud, you may use internet with maybe a wifi device like the ESP32 or ESP8266. This is a different project altogether different from this one.
You can Google to learn more about that.
- You must be logged in to reply to this topic.