[SOLVED] Raspberry Server Device Offline

Hi,
i’ve installed blynk on raspberry py, no problem with blynk cloud but i would like to do my local server. i have downloaded the server jar (21.8) and it runs because i receive my token via mail (via mailing.service configuration) but if i access to my Android APP i always have DEVICE OFFLINE notification.

when i was in blynk cloud the APP had no problems, could anyone help me to start the comunication between the PI local server anche the APP?

i tried to run a js via node from the same PI server:

OnOff mode
Connecting to: 192.168.1.31 8441
SSL authorization…
SSL not authorized

have installed SSL certificate…

Davide

1 Like

Have you entered IP address of local server in your
Sketch???

Have you also made the appropriate server login adjustments in the app?

hi,
yes i did, if i try to send the auth_ID via app i can do it so i think than the app can see the server (all mailing info are stored in mailing.services file) but it seems that can’t see the device…
do i need to activate the connection via .js?

when i used the blynk cloud i did execute the blynk command with token at reboot and i saw the device online, when using a local server is it the same? i though than executing che server in my PI3 i would see it in my app just like the cloud blynk: than with my other devices i can write pin value to the server and see it in the app…is it true?

i have no Sketch, i would write PIN value using the same PI3 i’m using like local server. otherwise, if i take local server, how can i see the device online? only when i write value with sketch?

Local Server is completely separate from Cloud server… different login on the app, different projects on the app (you can use the clone feature to transfer them), and in your sketch (on your hardware) you must change the auth code and IP address to match the appropriate Local Server IP and project auth in your app.

i took the different login and auth code in the app with new project but i don’t understand if to have the device online i need to write data using sketch or if i only need to start the server on my PI.
in local server when the device is online? and can i write values to my virtual pin using python and reading sensor values just using the same PI?

OK, now I am getting mixed info… to clarify, as I understand it:

You have installed Local Server on a RPi - and it is running.

You have logged into your Blynk app on your phone/tablet, using the custom login and the IP address and password for your Local Server on your RPi

You have an Arduino, ESP, ? using Ethernet or WiFi? that you should have some form of sketch installed (also with IP address pointing to your RPi) and the correct auth code for your app project.

Or are you ALSO trying to use your RPi as a client (and Local Server), instead of using an Arduino or ESP, etc?

sorry, i’m confusing you :grin:.

I have installed Local Server on a RPi - and it is running - right.

I have logged into your Blynk app on my phone, using the custom login and the IP address and password for your Local Server on your RPi - right, but i have “DEVICE OFFLINE” message; i also think its’ connected to the server because if i send the new auth code from my app i receive it to my mail configured in the RPI server, so i think than the app can see the server.

I have not yet activated arduino to send sensors value, because my sensors are installed on my RPI (the same one i’m using like local server) so i tryed to write values using the same RPI.

my first question is: my local server is on, but why i see DEVICE OFFLINE on my phone? do i need to create a .js to “connect” the app and the server? sorry but i have read the docs on github and it seems that i only need to execute the jar server…

thanks

@luzzidvd a server and a device are 2 separate things, although the Pi can be both.

So your local Pi server is connected and fine.
But you need to connect a device to the app. Most use ESP’s, some use Arduino’s and a small number use Pi’s.
The Pi being a server doesn’t make it a device though.
You need to run node.js on the Pi to set it up as a device if you haven’t already done so.

@Costas thank you. So i can’t use the same PI as server and device, understood.

Today i will buy another PI because i need it for my other projects and will try to use it as device, i’m using node but i tryed to connect via .js the same pi as device and server and i have SSL autentication problems.I’m using PI because it’s easier to connect via WIFI, i aven’t tried ESP but i will do.

thanks

No that is incorrect, the Pi can be the server AND the device.
But setting it up as a server does not make it a device.
There is a separate procedure for setting it up as a device and relates to the “sketch” referred to in the earlier posts.
Arduino’s have sketches.
ESP’s have sketches
Pi’s “sketches” are normally javascript via node.js.

In the docs it is covered by something like “connecting your Pi to Blynk” rather than setting up your Pi as a local server. You are doing both and that is fine, the Pi can handle it.

I have just recently gone through a bit of a challenge, trying to install Blynk as a client on RPI.

The directions in the DOC’s don’t seem to work… but I have had perfect success with another method (it uses wiringPI thus no NODE or NODE.JS required - I know, I have removed them on my RPi and the client still works great! EDIT - but I havent yet made any “sketches” so I could still need NODE??) - it is also by Blynk, so they may just need to update the DOCS or something.

Here is one site I found with all the steps - try it running simultaneously on your one RPi or wait for the 2nd as you say.

Change to regular TCP connection. covered in the docs.

could you please help me to unedrstand how to do it. I read the docs but i think i have not understood, i tried to mod the server.prop file and change the port of my .js script executed via node, but i have errors…

this evening i will try…
i remember when i tried to execute ./blynk with my local server token i had “bad token” error; but i did not tried to connect ./blynk with server specs so i will try and hope for this solution so i will can use it also to check my home temp, etc…

Swap the line that starts “var blynk …” in your js file for this:

var blynk = new Blynk.Blynk(AUTH, options= {connector : new Blynk.TcpClient(), addr:"xxx.xxx.xxx.xxx"});

@Costas thank you. this evening at home i will try…

@luzzidvd there are 2 references to blynk-cloud.com in /usr/local/lib/node_modules/blynk-library/blynk-node.js

You might have to change these to your local IP too.

@Costas and @Gunner you are great. I can now connect with both method you wrote me and now my device is online. i have now new questione. When i tried to use Blynk via Blynk cloud a wrote python command to write virtual pins using HTTP RESTful API, the command was: http://blynk-cloud.com/’ + self.auth_token + ‘/update/’ + self.pin + ‘?value=’ + self.valore. i’m doing the same thing with local server but i can’t write:
http://xxx.xxx.x.xx:8555/auth_token/update/V0?value=23 but i have errors:
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.7/urllib2.py”, line 154, in urlopen
return opener.open(url, data, timeout)
File “/usr/lib/python2.7/urllib2.py”, line 431, in open
response = self._open(req, data)
File “/usr/lib/python2.7/urllib2.py”, line 449, in _open
‘_open’, req)
File “/usr/lib/python2.7/urllib2.py”, line 409, in _call_chain
result = func(*args)
File “/usr/lib/python2.7/urllib2.py”, line 1227, in http_open
return self.do_open(httplib.HTTPConnection, req)
File “/usr/lib/python2.7/urllib2.py”, line 1200, in do_open
r = h.getresponse(buffering=True)
File “/usr/lib/python2.7/httplib.py”, line 1111, in getresponse
response.begin()
File “/usr/lib/python2.7/httplib.py”, line 444, in begin
version, status, reason = self._read_status()
File “/usr/lib/python2.7/httplib.py”, line 408, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ‘’

is it possible to use the same way HTTP RESTful API to write with Local Server?