RaspberryPi Setup

Hi there. I’m trying to make a fish counter. I’m a RaspberryPi model B and a PIR Sensor. I have the Sensor on pin 21 and I would like it to count whenever there is movement infront of it i.e.: whenever a fish swims passed it in a pipe then it will count that fish and I will have a total at the end of how many fish swam passed. I am struggling just to get the Pi up and running, I don’t know how to add the token as I have downloaded all the libraries and updates, but can seem to get it to connect to my phone. It just says the that new device is offline.
If anyone has any help to offer I would greatly appreciate it.
Thank you.

@blusoup have you created a new account since you moved from Cloud to Pi server?

Are you using wiringPi or nodejs?

i have both installed…

And the new account?

Do you know the commands you require (no pun intended) in nodejs for the PIR sensor?

no i don’t, i followed the instructions all way to nr 3 on the getting started page. I can’t figure out how to run a test script so I can enter my auth token

We count the number of burglars, rather than fish, with the PIR sensor attached to our Model B Pi so it can be done.

There are lots of slightly different instructions for setting up the PI.

First question are you using the Pi as a server or a client and a server?

2 Likes

I would think I’m running it as a server, as I have the app in my iPhone. If i can manage to use whatever it is how you set up your raspberry pi to count burglars that would be awesome

Ours also emails us a mugshot of the burglar :slight_smile:

Having the app on your Smartphone doesn’t indicate server or client.

Paste a link to the instructions you followed.

In the app there is a slider, default is to use Blynk’s cloud server, or you move the slider and enter your local IP address. Entering your local IP address will only work if you have gone through the Pi as a server, rather than Pi as a client, instructions.

ok so on the app if i tap on info it says Server: Blynk
So I presume that I’m using Blynk Cloud Server?
the link to the setup of the Pi is:http://docs.blynk.cc/#hardware-set-ups-raspberry-pi

That’s right, Blynk cloud server and Pi currently set up as a client.

In theory if you have created a “Project” in the app and you have the token it should simply be:

blynk-client your_token (replacing your_token with the 32 character token)

It will depend on various paths etc, but what happens when you try this?

do i just enter: blynk-client your_token (replacing your_token with the 32 character token) in the terminal of the Pi?

Yes, it should be as simple as that. You can use SSH from your “main” PC if you wish.

i’ll try it when I get home, as the Pi is powered off at the moment.
any chance you could send me the details of how you set the app up on your phone for giving you the amount of burglaries?
Thank you for all the advise by the way, I appreciate it!

There is very little in the app for the PIR, a single Value Display widget tied to a virtual pin would be enough.

The “counting” is done in the script. Are you familiar with nodejs scripts?

not at all. a little bit of python, but thats about it

Let me know if you connected with your token and then we can move on.

sorry it has taken me so long to respond. I have managed to get the token to work, but when i test the counter it says connecting to blynk, blynk connected and then it just disconnects again and keeps doing that on and off.
any ideas?

@blusoup do you have a script that you can post?

no, i do not have a script. would i be able to find one on the blynk website?

how were you able to “test the counter” if you don’t have a script?