masalinas / node-accelerometer-js

IoC proof of concept with Raspberry pi + I2C accelerometer + node-red only using javascript
Apache License 2.0
4 stars 1 forks source link

node-red-raspberry #2

Open masalinas opened 8 years ago

masalinas commented 8 years ago

picapp - apple macbook air 1

RAMI40 commented 4 years ago

Thanks for the sharing valuable information and the project.

I imported the flows into node red pi web designer and i am getting error "Imported unrecongnised types nodebot, gpio out". I have installed all necessary nodes for johnny pins and also installed nodes related to gpio for pi for node-red.

Is there something I am missing out here. Can you suggest or recommend some troubleshooting tips.

Thank you for your time and your cooperation. Regards

masalinas commented 4 years ago

When you installed all related dependencies in nodeRED could you see all new nodes included in the johnny package for example in the side menu of nodeRED??

RAMI40 commented 4 years ago

Yes, on the side menu of NodeRED i see under Raspberry PI rpi gopio in, rpi gpio out, ledborg, rpi mouse, rpi keyboard, pi gpiod, Sense HAT in, Sense HAT out.

These are all the nodes I installed after i was receiving the error after importing the flows.

I did not have npm installed so i run the following command below:- bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

and then i imported the flows in two different nodeRED windows as described below

Flow 1 - "Copy and import this flow from node-red import clipboard to crete the raspberry pi flow" under Node-RED flow Designer in raspberry pi (127.0.0.1:1880). The issue here is that the address I am using is not the same you mentioned. You mentioned (http://192.168.1.45:1880).

Flow 2 - "Copy and import this flow from node-red import clipboard to crete the raspberry pi flow" under Access Node-Red server Web designer (http://localhost:1880/)

Please could you also mention what is the expected output of the mpu6050 node if there flows were to work and if the MPU 6050 was wired up with Pi

Below I have uploaded the figure of interfacing Pi with MPU 6050. Could you please confirm if this is correct.

Thanks and Best Regards

Rasberry Pi interfacing with MOU 6050

masalinas commented 4 years ago

You said that you don't have npm installed, in your raspberry. I recomend that you installed the last stable node version in your Raspberry SO and of course the last npm package manager first. Also use the last stable nodeRED in your project and not the default one that could be installed in the Raspberry SO.

Any way, check this link if it could help you:

Node "rpi-gpio out" doesn't do the expected in GPIO 18 (Pin 12)

RAMI40 commented 4 years ago

Thanks for the reply.

I installed npm after running the command on Pi:-

bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

So now i have npm installed.

Thanks for the link I am looking into it

If the project works normally then what can be seen in the debug window in Node RED. I mean what is the result. Do values from MPU 6050 appear in Debug Window in Node RED for example Acceleration in X, Acceleration in Y, Acceralation in Z, Yaw, Pitch and Roll

masalinas commented 4 years ago

Debug in nodeRED doesn't really exist.

You could trigger debug logs to the right side panel of nodeRED or use lamps in your nodes indicating the status like you know but not more.

If you need any more complicated debug in a more complicated logic in javascript or other backend language for your data received from your hardware devices I recomend implement this logic outside nodeRED using for example the IBM Loopback framework is you are using a nodeJS backend. I used it many years and is fantastic nodeJS backend framework. Thwen you could use the API services exported by this framework or others in your flows using the javascript node of nodeRED or directly the HTTP. I recomended the first option.

My 5 years experience in nodeRED tell me that not build your logic inside nodeRED only use nodeRED like a message router.

The correct flow must be: capture the outside dara inside nodeRED, transfom, persist, etc this data outside nodeRED (IBM Loopback for example) and publish the results alarms etc inside nodeRED to other UI services like Angular, React ot any client side framework that you prefered.

Good Luck in your project!

Regards

RAMI40 commented 4 years ago

Thanks for the detailed answer.

With Debug window i meant the Panel / Window in NodeRED.

Best Regards