cylon.js & arduino uno: execute program without cable connection to PC - node.js

I am new to this field, so this might be an odd question.
We can write a code(say blinking lights) in the aduino IDE and upload it to arduino and we can disconnect from the pc and the program will run. (blinking will happen).
Now when we are using cylon.js and write the program and execute say
$ node blinking.js
then as long as the arduino is connected to the pc(or laptop) the blinking happens and when I kill node js or disconnect arduino from pc the blinking stops. (this is how its suppose to happen, right?)
So my question is,
if I have a arduino with a temperature sensor some where outdoor and I have a cylon.js program to use those sensor data and do some things (say print them), then how can I achieve this ? Do I have to have two arduinos which are connected via wireless or gsm shields (one outdor and one connected to the pc where the cylon.js is running)?
or is there a simple way of doing this? Any insight on this is much appreciated.
Thank you

then as long as the arduino is connected to the pc(or laptop) the
blinking happens and when I kill node js or disconnect arduino from pc
the blinking stops. (this is how its suppose to happen, right?)
Correct. This is true for any Node.js program controlling an Arduino, whether with Cylon.js or Johnny-Five.
if I have a arduino with a temperature sensor some where outdoor and
I have a cylon.js program to use those sensor data and do some things
(say print them), then how can I achieve this ?
It's not possible with just an Arduino board. You can use a pair of Xbee modules, which will allow your Arduino to communicate with the host machine, or just use a board that has wifi or bluetooth capabilities, such as:
Spark Core
Electric Imp
Intel Galileo
Intel Edison
Raspberry Pi
BeagleBone
pcDuino

Related

transfering data between 2 python programs on different devices

I'm working on a project to control a drone using an EEG headset. The EEG headset is connected to my laptop [runnig ubuntu 18.04] and the drone to the raspberry pi [raspbian].
The code for processing the EEG data on the laptop as well as the code to control the drone is written on python 3.6 and work without any problems.
setup:
the EEG headset[ neurosky mindwave mobile 2] and the drone[ parrot mambo] both use BLE[bluetooth low energy] to connect with the devices. since both of them use Bluetooth it would be hard to send and receive data simultaneously to both the devices using a single code and laptop as they require a continuous uninterrupted connection and high data rates. hence the EEG headset is connected to the laptop via BLE and similarly the drone to the raspberry pi 3b+. The laptop takes care of processing the EEG signal and determining the desired command, while the raspberry pi acts as a wireless controller for the drone.
system setup
I need to pass the values between these 2 codes[and devices] so as to control the drone using the EEG signal. For eg, if I want to make the drone go forward after processing the signal I need to send say "1" or "f" to the raspberry pi from the laptop.
A wired connection such as Ethernet cable or USB is preferred over a wireless method.
The data size and rate is very less as a single character is sufficient and it will be sent only once every few seconds.
Which would be the best method to achieve this sort of communication
Use kafka or 0mq to loosely couple the laptop sender to the rasp pi receiver.
If one of them reboots, that's ok, the other will keep plugging away.
In the kafka case, you will enjoy the advantage of being able to replay a laptop publisher session again and again as you tweak and test the rasp pi client code.

Arduino light blinking not working after stopping node.js program

i am new in arduino, but i do have knowledge of Node.js.
recently i brought arduino uno board. i have tried basic/hello world program of arduino which is LED light blinking, for that i am using jhonny-five.js.
i have plugged arduino board to my laptop, then i uploaded firmata to board and then i run node.js program on my laptop it is working fine, LED light is blinking. every thing is working like charm.
but when i stops the node.js program then LED light stop blinking. basically i want to do that when i just power-up the board, it should run LED blinking functionality.
right now i need to plugin device, then run that node.js program. this way it is working.but is there any way where i just plug arduino board and it automatically runs LED blinking functionality without running node.js code on my pc.
The Firmata library is exactly for receiving commands over Serial port. So you can run code on your computer and commands that must be executed in Arduino are sent there. But without that program, it's just waiting for commands, so it does "nothing".
If you wan't stand-alone program, you have to use Arduino IDE and upload code directly.

Reading parallel port data meant for printer

I have a 20 year old device that prints data through a 1994 HP Deskjet 550c printer using a parallel port. Now the printer is broken and so there's no way to view the device output. I was thinking of hooking the parallel port from the device to a Raspberry Pi 3 which will display the data on a computer screen. I can get a parallel to USB cable which connects the old device to the Raspberry Pi. When I press the print button on the device, data should be sent to the Pi, but what I'm worried about is the format of the data. Is there a standard protocol for print data, or does every printer manufacturer use their own protocol? Do you know of any open sourced python scripts that can directly parse the print data coming from the usb port? Do I need to install any drivers on the Pi?

Arduino nano, sound detection

I got an Arduino nano V3.0, connected via USB to my computer, and powered with the USB.
I want to use the nano to send a signal over the USB to the computer when it detects a sound of some amplitude.
Anybody knows how to connect a sound sensor to nano as easily as possible?
thanks
rough
I found this link useful http://arduinobasics.blogspot.com/2013/05/sound-sensor.html. Just connect sensor to arduino and adopt code for your needs (you don't need leds, just sensor). To send sensor status over USB use Serial class on Arduino and terminal application on PC.
You have 2 options, one of them is to buy a microphone which outputs a pulse when sound exceeds the threshold you've set on the potentiometer on the board, for example this one: Microphone Detector
The other option is to buy a microphone which outputs an analog stream which can be read by the A0 port on the Arduino Nano.
This Adafruit link can help you understand the code. As you can see, the analogRead(0); reads the A0 port of the arduino.

Raspberry Pi to PC over UART doesn't work

I am trying to send/receive data over serial connection (GPIO UART pins) between a Raspberry Pi (B model, raspian wheezy) and any pc (tried a netbook and desktop, both running with win 7).
I followed all the stepts found in several tutorials like: http://codeandlife.com/2012/07/01/raspberry-pi-serial-console-with-max3232cpe/
to build a 5V to 3.3V converter. (unfortunately i can't post a pic yet)
The settings for ttyAMA0 in files 'cmdline' and 'inittab' are ok. (like described in many tutorials)
Connecting RX/TX on rpi direct works fine, so i can send text over GPIO pins and receive it. But as i connect it to a pc there is no way to read or write any data. Baudrate 9600 or 115200 doens't matter. (Hardware connection: rpi GPIO -> voltage converter -> serial USB adapter -> pc)
On pc i used Putty. On the rpi:
'echo text >> /dev/ttyAMA0' on the terminal
Putty and
minicom
but no one had success
Is there anything i missed? Could you give me some advice i could look for please.
some ideas:
Whereever i plug the usb into one of 3 available netbook USB ports the win device manager always say it's on COM3... shouldn't it change?
is there a possibility to make some measurements inside the voltage converter wiring to insure that it's not a broken component in the hardware circuit? (i have no knowlegde of it's function)

Resources