Soi think i understand, how i can install client with C++ library ? wiringpi is out
If it’s more easy ( as i look on different post ) i take this way
To run C++ on the Pi you need to install WiringPi, but WiringPi is now deprecated so you should not go down that route.
Pete.
So you say node is not better way for me and my project and is no other solution than node ?
for conclusion is not possible to use blynk by this way. I’m disapointed for that. Maybe later on otherplace i find some help with a clear explication to do my project.
it’s never easy when you have reduced comprehension skills.
Thanks.
No, I didn’t say that, I said that C++ isn’t an appropriate solution.
It’s perfectly possible to use Blynk with NodeJS and local server, and I’ve linked you to a topic which shows how to do that, it’s just that you appear to be more comfortable following unofficial YouTube videos than reading the document which is shown in that video or reading topics from a respected community member who has taken the time to put together a NodeJS help topic.
Pete.
I take time for this but i don’t understand. If i understand i don’t open a topic for.
ok something like this don’t work :
const Blynk = require(‘/home/pi/my-awesome-project/node_modules/blynk-library’); // Links variable ‘Blynk’ to the Blynk Library
const AUTH = ‘lu45Oqq80QUverQPDItJEX9EukGwMG7t’; // Your top secret auth code
const blynk = new Blynk.Blynk(AUTH, options = {
connector : new Blynk.TcpClient( options = { addr: “192.168.1.35”, port: 9443 } ) // This takes all the info and directs the connection to you Local Server.
});var AUTH = ‘lu45Oqq80QUverQPDItJEX9EukGwMG7t’;
var blynk = new Blynk.Blynk(AUTH);
var v1 = new blynk.VirtualPin(1);
var v9 = new blynk.VirtualPin(9);v1.on(‘write’, function(param) {
console.log(‘V1:’, param[0]);
});v9.on(‘read’, function() {
v9.write(new Date().getSeconds());
});
It giving me :
pi@raspberrypi:~/my-awesome-project $ node index.js
/home/pi/my-awesome-project/index.js:7
var AUTH = ‘lu45Oqq80QUverQPDItJEX9EukGwMG7t’;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Identifier ‘AUTH’ has already been declared
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
That’s fairly self explanatory.
Maybe if you used the example from @Gunner that I linked you to earlier then it would be simpler.
Pete.
I’ve used it and i add this to the script :
For Local Server:
const Blynk = require('blynk-library'); // Links variable 'Blynk' to the Blynk Library
const AUTH = 'xxxxxxxxxx'; // Your top secret auth code
const blynk = new Blynk.Blynk(AUTH, options = {
connector : new Blynk.TcpClient( options = { addr: "xxx.xxx.xxx.xxx", port: 8080 } ) // This takes all the info and directs the connection to you Local Server.
});
It don’t work like this ?
I think i don’t know what he’s mean with your top secret auth code
It’s not just a case of adding it to the script, it’s a case of changing the original script to use these settings instead of the one from the original script.
Pete.
Ho, ok and where’s the orignial script ?
You created it, if you followed these instructions…
http://help.blynk.cc/en/articles/583104-how-to-install-node-js-library-on-linux
Now create your main script file
index.js
(just replaceYourAuthToken
):
Pete.
yes, it’s to step when a create new project
Like this ? that’s when i execute this script i have the return
That isn’t the original script, it’s the script that you’ve incorrectly modified by adding-in some additional code without removing parts of the original code.
Pete.
Ok it working… Maybe you can say at the begining just change this by this.
Thanks
Ok i post here but isn’t same issues…
So now i’m connecting Raspberry on my smartphone hotspot. I can see serveur administration dashboard by this way ( on browser ) https://myip:9443/admin
But it don’t work with Blynk application. It can’t fond server.
Some solution for fix it ?
Thanks
So in your other topic you said something different…
And I replied…
Are you now saying that the issue is different, or that using the actual IP address of the server (192.168.1.35) rather than the loopback IP (127.0.0.1)?
Also, it’s normal to use port 8080
Pete.
sorry i don’t paste all my post
This’s connect to smartphone hotspot
So i use server and client on same device. My client conatct server on 127.0.0.1. it work.
On blynk app on custom i use RaspberryPi IP and don’t find server. I don’t understand it work like that to my router but no to the hotspot from my smartphone
How it work, blynk app ask for client or server ?
Is your phone connected to your home WiFi, or to GPRS, or to a different WiFi network?
Pete.
Phone is connected to GPRS in hotspot mode for share connexion and the raspberry connected to this hotspot
With ip adress Juicessh and my navigator find the RaspberryPi, i can connect to admin interface server