Can you use Eventor with Digital Pins on Raspberry Pi

Hi
In a project I’m doing if the camera doesn’t recognise any motion I need it to send a notification.
With Eventor you can send notifications based on the state of virtual pins but I was wondering if I wrote in my code that if no motion is detected make a digital pin go high, is there a way to have a virtual pin go high if a digital pin goes high? That was it could then send a notification…

If there is another way to do that i’d be very greatful.

Eventor can toggle digital pins, but I don’t think it can read them without code on the device to do a periodic digitalRead(pin) and then with a if() process, a Blynk.virtualWrite(vPin, 1) when the digital pin state is HIGH (or whatever equivalent RPi programming methods for all those commands are). Then Eventor can read the result of that vPin from a display widget or something.

Sorry you’ve lost me there…
So are you saying instead of setting a digital pin high i could just input a process into my code that if no motion occurs it sets Blynk.virtualWrite(vPin,1) HIGH? Then the Eventor can read the result of the vPin and display etc?

Yes… but of course if you need to write code to do all that, then just skip the Eventor and use the code to send to the display or whatever action you need to do.

What language are you using for Blynk anf the RPi? NodeJs (Javascript) or WiringPi (C++)

Right okay… i’m still a little confused… ha! The code im trying to edit and implement this in is written in C++
I thought I would just have to copy and paste the code from the example into where I need it to be implemented from and it would work… Sorry I am very new to coding!

Well, for relatively code free Blynk integration Eventor is great, but has limitations.

Since you are already using a RPi with camera and some form of motion-sensing with ability to toggle GPIOs based on motion or not… then I figured you had to have some coding background :wink:

WireingPi uses C++ but since it is a ported language (if I am using the term correctly) it is not entirely the same as on an ESP or Arduino… so copy/pasting existing Arduino code will not necessarily work.

I personally stay away from WireingPi becasue of that potential confusion (as experienced in the past when I first tried it)… I use C++ for Arduino and ESP… and Javascript for RPi.

Aha! I haven’t set the motion sensing ability to toggle the GPIO pins based on motion yet, that was my idea on how I could get it to work with Blynk :smile:

Right okay… I’ve used Javascript successfully for getting my DHT sensor to work with Blynk for notifications.

So how would you suggest that I get Blynk to do notifications for my motion detection from the camera? lol!

Also…I’ve set up Eventor codes for Humidity and Temperature but for some reason only the humidity is sending notifications, even though both should as I’ve made them go beyond the set limits…
any ideas why that would be the case?

Not a clue of an answer to all your questions without much more information :stuck_out_tongue:

  • What type camera?
  • How is it hooked up?
  • Do you have any current form of ‘seeing’ what it sees?
  • How is the DHT(11 or 22) physically setup?

  • How are you reading the single pin digital data from it and converting it to discrete Temperature and Humidity data before viewing it on the App?

Pi NoIr Camera Module through CSI port
I can view it when i run the test code in a terminal window as it opens a preview of the camera feed

I’ve managed to sort the DHT so its doing it now, but only when sudo node blynk-sensor-test.js is running in a terminal window… I’m guessing i’ll have to add that to run on startup if I want it to work all the time without my input?

OK, I have same camera… So far, I have been able to use a Blynk Button to take a snapshot and display it on a little OLED… using a Python demo script for the OLED to do most of the work.

When I have the clarity of mind, I do plan on setting up something like an App button that will start/stop a video stream, viewable on the Video Widget.

Basically you need to find a Python or JS script that will do most of what you want with the camera interface, then control it (as a child process) from your Blynk script.

Adding & at the end of that command should keep it running after closing the terminal… at least as until the RPi reboots. Otherwise if you want it to always run, then you need to add that command into your /etc/rc.local file… and other options are available… Google for details on all that.

sudo node blynk-sensor-test.js &

I have a second Pi and camera module streaming video and audio to a web server so I don’t need to be able to view it through Blynk (I would if it streamed audio too)

Basically the first camera is running the motion software and that’s all and I just need to get it to send notifications when no motion is detected… at the moment it is calling a function which plays an alarm sound, so just trying to add another function to it i guess…lol

Brilliant, I knew it would probably mean adding it into the /etc/rc.local file, i’ve done that already to get Blynk to run from startup… I’ll try the & idea first though :slight_smile:

@Gunner, I’ve added that code you said to use below into the rc.local file but it doesn’t seem to be working. I think the issue is that the widget isn’t updating, so the value never changes.

Any ideas how I can resolve this?

Cheers

While that command may work as-is when typed from withing the correct folder… it will not work without all the relevant file paths incorporated into the commend when placed in the /etc/rc.local

For example, I have a sketch (index.js) that needs all this in order to automatically start… obviously your paths and names will differ.

sudo node /home/pi/Blynk-Test/index.js &

LOL as soon as I read you reply I realised that I’m an idiot! Cheers! :joy:

1 Like