ESP-32 - An alternative to Raspberry Pi for PrivateEyePi

192 views
Skip to first unread message

Gadjet Nut

unread,
Jan 23, 2021, 1:42:17 PM1/23/21
to PrivateEyePi
See this blog from JemRF and link to their tutorials for step-by-step guide to setting up PrivateEyePi on ESP-32 instead of using a RaspberryPi. They also show you how to use the Flex RF Module instead of the Raspberry Pi Wireless Gateway for their RF Sensors. 

The ESP-32 is a microprocessor so has some advantages over Raspberry PI because you don't have all the overhead of of an operating system to worry about. You can treat like an appliance and switch it on off without worry of corruption. Also much quicker to set up. 

Ian Murray

unread,
Feb 8, 2021, 9:43:22 AM2/8/21
to PrivateEyePi
I am currently in the process of moving my Raspberry Pi applications onto ESP-32 boards. A couple of questions about the above conversation. Has anybody successfully got PrivateEyePi working on an ESP-32, I have tried the JemRF version and have a couple of issues, but not sure if they are user errors or code.  Does PrivateEyePi intend to provide a ESP32 version of the Raspberry Pi code. Thanks. 

Gadjet Nut

unread,
Feb 8, 2021, 10:56:03 AM2/8/21
to Ian Murray, PrivateEyePi
Yes I have the JemRF esp-32 code running for PrivateEyePi OK. Everything is working except the BME280 sensor interface. We work closely with them. Feel free to post the problems you have and we can get working. 



--
You received this message because you are subscribed to a topic in the Google Groups "PrivateEyePi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/privateeyepi/t88Isr1nP7s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to privateeyepi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/privateeyepi/fadc53c6-236b-4a9a-a3d0-8a5c87fd3c5bn%40googlegroups.com.

Ian Murray

unread,
Feb 8, 2021, 12:13:27 PM2/8/21
to PrivateEyePi
Thanks for the help, currently ESP32 is on breadboard for testing with 3 pins grounded. I get the following output on the monitor when an alarm is generated.

===============================================================================================

16:55:38.998 -> Connecting to WiFi...
16:55:39.511 -> Connected to the WiFi network
16:55:39.511 -> Wired sensor 5=0
16:55:39.696 -> Wired sensor 18=0
16:55:39.883 -> Wired sensor 19=0
16:56:50.105 ->  Sensor 18 Value 1
16:56:50.105 -> Requesting URL: 
16:56:51.915 -> 200
16:56:51.915 -> /SEMAIL,18,/n,/SIREN,0,18,/n
16:56:51.915 -> Requesting URL: 
16:56:53.450 -> 200
16:56:53.450 -> Office,Door,/n
16:56:53.450 -> Requesting URL: 
16:56:54.962 -> 200
16:56:54.962 -> /ADDRESS,xxxx...@btinternet.com,/n
16:56:54.962 -> Received Address details
16:56:54.962 -> xxxx...@btinternet.com,
16:56:55.010 -> connected email server
16:57:05.003 -> 10 sec 
16:57:05.003 -> Timeout
16:57:36.002 -> Requesting URL: 
16:57:37.494 -> 200
16:57:37.494 -> TRUE,/n
16:57:38.471 -> Requesting URL: 
16:57:40.035 -> 200
16:57:40.035 -> TRUE,/n
16:57:41.013 -> Requesting URL: 
16:57:42.597 -> 200
16:57:42.597 -> TRUE,/n
16:57:43.576 -> Requesting URL: 
16:57:45.377 -> 200
16:57:45.377 -> TRUE,/n
16:57:46.354 -> Requesting URL: 
16:57:48.308 -> 200
16:57:48.308 -> TRUE,/n
16:57:49.318 -> Requesting URL: 

=============================================================================

The email fails then the http request is sent out every 2 seconds. 

Gadjet Nut

unread,
Feb 8, 2021, 6:00:44 PM2/8/21
to Ian Murray, PrivateEyePi
It looks to be working as designed. When you triggered GPIO 18 it sent a message to the server and it received a reply telling the ESP32 to send an email alerts and to trigger an external sirem:

/SEMAIL,18,/n,/SIREN,0,18,/n

The email failed to send, so you will need to look into that and see if your email server is able to relay emails from a remote device on port 80. Otherwise use an email service like SMTP2GO. 

Then the siren is activated and the function=16 messages you see every 2 seconds are the Esp-32 checking in to PrivateEyePi for siren deactivation. Press the red button on your PrivateEyePi dashboard to reset the alarm and these messages will stop, or timeout after 120 seconds (#define SIREN_DURATION 120)

Hope that helps.



You received this message because you are subscribed to the Google Groups "PrivateEyePi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to privateeyepi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/privateeyepi/2d5d3f5d-0bde-4aa6-b839-0ede25115d4fn%40googlegroups.com.

Ian Murray

unread,
Feb 9, 2021, 7:09:15 AM2/9/21
to PrivateEyePi
Thanks for the quick reply, I have the SIREN_DURATION set to the default of 120, but the messages go on for 5 minutes (not a problem for me). SMTP2GO seems to need you to have a corporate email domain name to use the service, which I don't. My other applications are using ESP32_MailClient.h, which allows me to send emails from gmail.com and btinternet.com

Thanks for your help.

Gadjet Nut

unread,
Feb 9, 2021, 7:03:51 PM2/9/21
to PrivateEyePi
I'll fix the SIREN_DURATION issue. It polls the server 120 times with a second delay in between polls but doesn't take into account the time it takes to do the poll and check the result. Therefore the total time is longer than 120 seconds. Same for SIREN_DELAY which is the time between the alarm trigger and the siren. 

Ill look into ESP32-MailClient and see if we can reuse. If you are modifying the code for ESP32_MailClient let me know how it goes.

Ian Murray

unread,
Feb 11, 2021, 12:12:23 PM2/11/21
to PrivateEyePi
Thanks for the update, unfortunately I don't have the skills to modify the code to use the ESP32_MailClient, but would be interested if anybody else manages too. 
Reply all
Reply to author
Forward
0 new messages