- 06/10/2019 at 20:42 #5918pepoversesaParticipant
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 #5933Bitahwa BinduKeymaster
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 #5935pepoversesaParticipant
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 #5936Bitahwa BinduKeymaster
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.
- You must be logged in to reply to this topic.