Yes see the docs at http://docs.blynk.cc/#hardware-set-ups-raspberry-pi
ok thanks but just to be sure, you mean i can use my pi as a local server and controle it with the blynk apps in the same time?
yes but you will only have local control, not internet control, unless you expose (port forward) the Pi to the internet.
thanks for your help thatās what i want!
I think correct link would be http://docs.blynk.cc/#blynk-server-how-to-run-local-blynk-server-how-to-launch-blynk-server-on-raspberry-pi
I have followed this thread attentively, thanks!
So far, I have been able to set up the blynk app on the iPhone and use the application with the Rasberry Pi to switch on and off some LEDs.
I have also been able to install the local server on my - same - raspberry Pi and get it up running.
However - when switching to custom mode on the app and using the parameters provided concerning IP and ports - the app tries to connect, but I get the response that the server is not responding.
Whatās to be done?
Thanks in advance for help
Can you confirm the server is actually running? Can you for example telnet on the Raspi to localhost on the 8443 or 8442 port?
⦠Well, upon starting blynk server I get a message at the prompt, that the software was successfully started and any logs would be filed in a certain folder.
Checking this folder I actually find some messages warning me about security aspects from certificates used.
From this I concluded that the software was up and running, but maybe Iām wrong.
I didnāt check any specific ports for the simple reason I wouldnāt know how toā¦
Thanks for your reply in advance!
First, you can try this and see if the server is running, output should be this:
OpenELEC:~ # ps -ef | grep server
1112 root 12:22 java -jar /storage/blynk/server.jar -dataFolder /var/media/Data2/blynk-files
2056 root 0:00 grep server
OpenELEC:~ #
But from what you tell, that should be OK. You can see if the port is actually listening like so:
OpenELEC:~ # netstat -an | grep 844
tcp 0 0 :::8441 :::* LISTEN
tcp 0 0 :::8442 :::* LISTEN
tcp 0 0 :::8443 :::* LISTEN
This tells you there are processes listening on the Blynk ports.
What you can do is try and telnet from another PC in your network, or the localhost to the specified ports:
(please note that Windows 7 and up donāt have telnet app enabled by default!)
MacBook-Pro-van-Bastiaan:~ bastiaan$ telnet 192.168.0.25 8443
Trying 192.168.0.25...
Connected to 192.168.0.25.
Escape character is '^]'.
This says the computer is connected to Blynk server and you should be able to connect with the App and/or your hardware to the Blynk server.
Thanks again!
I was able to telnet localhost on both ports 8443 and 8442 and got a message that said there was a connection to localhost, which was terminated after a timeout.
From this I conclude that the local server is up and running.
What I further did:
- I started the local app, which gives the message that it is running and connected to the blynk cloud
- I started the local server (with the above results by means of telnet)
- I logged in to the app on iPhone, switched from cloud to local mode, didnāt give any IP address, just the port 8443. The app then did some magic synchronisation, found the raspberry and I was able to play with with the loaded buttons, which worked fine. So this is one big step forward!
The questions f I am asking myself are now:
Am I working under purely local conditions? Am I working under cloud conditions (irrespective of the local blynk server running)? Am I accessing the local server with my iPhone by means of Internet?
Thanks again for your help.
@chrisb I think your problem is that you are not in your local network. What is IP of your local server? What type of connection do you have on mobile app and where do you connected to?
If you use the local server as you imply here, there is no internet connection needed whatsoever. This means you could also use an ipad or tablet connected to wifi only.
Everything you do is contained to the local network (unless you open up ports to the outside world, but thatās another story).
@Lichtsignaal: Thank you for pointing this out to me, obviously I have mixed up some basic conceptsā¦
My next steps:
I have started the local blynk server
I have set the iPhone app to local , typed in the appropriate local IP address of the Rasberry (192.168.1.111) into my iPhone (local IP 192.168.1.103) and on logging in got the following message in the log files:
11:40:46.455 INFO - Using data dir ā/home/pi/Blynkā
11:40:48.592 INFO - Initializing mail transport. Username : example@gmail.com. SMTP host : smtp.gmail.com:587
11:40:49.734 INFO - Plain tcp/ip hardware server port 8442.
11:40:49.742 WARN - ATTENTION. Certificate /home/pi and key /home/pi paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
11:40:52.102 INFO - SSL hardware port 8441.
11:40:52.125 WARN - ATTENTION. Server certificate paths cert : ā/home/piā, key : ā/home/piā - not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
11:40:53.661 INFO - Application server port 8443.
11:40:53.779 INFO - HTTP API port 8080.
11:40:53.800 WARN - ATTENTION. Certificate /home/pi and key /home/pi paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
11:40:55.865 INFO - HTTPS API port 9443.
11:40:55.912 WARN - ATTENTION. Certificate /home/pi and key /home/pi paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
11:40:58.064 INFO - HTTPS admin UI port 7443.
11:40:58.168 INFO - HTTP reset pass port 7444.
11:40:58.171 INFO - Web Sockets port 8082.
11:40:58.174 WARN - ATTENTION. Certificate /home/pi and key /home/pi paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
11:40:59.850 INFO - Web SSL Sockets port 8081.
11:42:07.975 ERROR - User credentials are wrong. Username āā¦@bluewin.chā, /192.168.1.103:50225
From this I conclude:
- the local blynk server is up and running
- The iPhone can address the Rasberry/blynk Server over the WLAN
- The blink server doesnāt recognise my credentials
So the relevant question -apart from the parametrising of the mail address et cetera - seems to be how to tell the blynk server to recognise the credentials provided by the blynk App on the iPhone.
Thanks in advance for further instructions!
@Dmitry: thank you for your input. The local IP address of the Rasberry is 192.168.1.111, the local IP address of my iPhone with the blynk app is192.168.1.103. As you can see from my reply to lichtsignaal, I have the impression that the two applications on the iPhone and the Rasberry respectively can communicate. From the logs I get from the blynk server on the Rasberry I conclude that the main current issue is that the blynk server doesnāt recognise the credentials provided by the app on the iPhone
Thanks a lot in advance for further instructions!
@chrisb when you first installed the Blynk app did you go for the Cloud (internet) connection rather than the local connection?
You might need to go back in and edit the app settings.
@costas: Thanks! Yes, that is exactely what I did: I installed the app on the iPhone and - upon downloading the server software tried to access the local server by means of iPhone/Wlan
I believe the app defaults to the Cloud. If you havenāt already done so look at the changes for local server at http://docs.blynk.cc/#blynk-server-update-instruction-app-and-sketch-changes
Error is pretty clear. Cloud server and local not related at all. So if you havenāt create an account for local server you have to create one. For that please follow link @Costas mentioned.
@Dmitry: thanks!
Iāve created a new account for purely local server access, from the log file I can see that my app has joined. However, on pushing some buttons on the iPhone app I get the error message, that the server is off-line. Iāve read the the instruction from the link Costas mentioned, but wasnāt able to identify the relevant files where the changes should be made.
I think you mean hardware.
In case of local server your sketch should also point to local server.