Skip to content

Instantly share code, notes, and snippets.

View dmalawey's full-sized avatar
💭
performing kaizen

David dmalawey

💭
performing kaizen
View GitHub Profile

Start the nodeRed installation:

Running Node-RED update for user pi at /home/pi on raspbian

This can take 20-30 minutes on the slower Pi versions - please wait.

Stop Node-RED                       ✔
Remove old version of Node-RED      ✔
Remove old version of Node.js ✔
@dmalawey
dmalawey / wpa_supplicant.conf
Last active February 11, 2022 18:14
wpa supplicant example
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
# First network to search for
network={
ssid="your_ssid"
psk="your_password"
}
@dmalawey
dmalawey / noderedExtractTwoValuesFromObject
Created September 9, 2020 07:26
make a function in nodered to extract individual axes from the gamepad
[{"id":"4a052b50.075214","type":"tab","label":"PlotGP","disabled":false,"info":""},{"id":"350633a1.11bc9c","type":"ui_gauge","z":"4a052b50.075214","name":"","group":"341ef7b5.bb9218","order":1,"width":"5","height":"5","gtype":"gage","title":"Axis0 (theta dot)","label":"percent","format":"{{value}}","min":"-100","max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":460,"y":280,"wires":[]},{"id":"1cbd9feb.395ee","type":"file in","z":"4a052b50.075214","name":"read uFile.txt","filename":"/tmp/uFile.txt","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":130,"y":120,"wires":[["7d96ee41.f7f52","9f412f87.46433"]]},{"id":"7d96ee41.f7f52","type":"csv","z":"4a052b50.075214","name":"parse values","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"GP_tdot, GP_xdot","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":190,"y":180,"wires":[["2c3f9ccf.818b84","d7dc5615.75ce08","99988631.c44068"]]},{"id":"2c3f9ccf.818b84","type":"debug
@dmalawey
dmalawey / vscode_config_SFTP.json
Created September 9, 2020 06:38
vscode configuration for pi SFTP over wifi
{
"name": "SCUTTLE",
"host": "192.168.1.8",
"protocol": "sftp",
"port": 22,
"username": "pi",
"password": "raspberry"
"remotePath": "/home",
"uploadOnSave": true
}
@dmalawey
dmalawey / myEmbeddedLinuxNotes.md
Last active June 21, 2021 21:20
David's Notes for Linux & Pi Setup, Installations, etc.

Linux & Pi Short Notes:

This document is for all steps getting started with an embedded Linux Machine and specifically addressing the path for SCUTTLE developers who lack formal training in computer science such as myself. -DM

Syntax guide for formatting in markdown

I am using markdownguide.org for formatting this document.

Wifi setup (Option 1)

  1. SSH must be enabled on the Pi. Go to the raspi SSH documentation and use STEP 3 to enable SSH directly from the SD card.

  2. Create the wpa_supplicant.conf file and configure it to give WiFi access to the Pi. Use this method when you have no monitor.

@dmalawey
dmalawey / flow_gamepad_axis_plot
Last active September 6, 2020 14:30
nodered flow for plotting single axis of gamepad on SCUTTLE Robot
[{"id":"4a052b50.075214","type":"tab","label":"PlotGP","disabled":false,"info":""},{"id":"dc90d6ca.9573c8","type":"ui_chart","z":"4a052b50.075214","name":"GamePad axis0 Chart","group":"341ef7b5.bb9218","order":6,"width":0,"height":0,"label":"Gamepad Axis0 Chart","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"Waiting for Data...","dot":false,"ymin":"-100","ymax":"100","removeOlder":"10","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":240,"y":260,"wires":[[]]},{"id":"350633a1.11bc9c","type":"ui_gauge","z":"4a052b50.075214","name":"","group":"341ef7b5.bb9218","order":1,"width":0,"height":0,"gtype":"gage","title":"Gamepad Axis0 Value","label":"percent","format":"{{value}}","min":"-100","max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":240,"y":220,"wires":[]},{"id":"1cbd
@dmalawey
dmalawey / flow_mqtt_csv_2
Last active September 4, 2020 02:29
nodered receive mqtt message and save in csv
[{"id":"22de6241.99d99e","type":"tab","label":"ReceiveMQTT","disabled":false,"info":""},{"id":"fa9bfea5.972ee","type":"mqtt in","z":"22de6241.99d99e","name":"","topic":"SCUTTLE/pi/cmd","qos":"2","datatype":"auto","broker":"1cc0cc73.690154","x":120,"y":80,"wires":[["721e0737.c93978","8d8ca943.671f88"]]},{"id":"721e0737.c93978","type":"csv","z":"22de6241.99d99e","name":"","sep":",","hdrin":false,"hdrout":"all","multi":"one","ret":"\\n","temp":"fieldA, fieldB","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":180,"y":180,"wires":[["cc5a197f.041b88","5895d1cf.f5221"]]},{"id":"cc5a197f.041b88","type":"file","z":"22de6241.99d99e","name":"","filename":"/home/pi/piScuttle/data3.csv","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"none","x":350,"y":240,"wires":[[]]},{"id":"5895d1cf.f5221","type":"debug","z":"22de6241.99d99e","name":"debug3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","sta
@dmalawey
dmalawey / flow_mqtt_csv_1
Created September 3, 2020 06:45
nodered flow for retrieving csv info and sending mqtt message
[{"id":"22de6241.99d99e","type":"tab","label":"GamePad","disabled":false,"info":""},{"id":"3f6df30c.f1a0bc","type":"csv","z":"22de6241.99d99e","name":"","sep":"\\t","hdrin":true,"hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":370,"y":280,"wires":[["51721a8b.c03934","6003e56b.07b51c"]]},{"id":"d4cc4cd7.6b652","type":"file in","z":"22de6241.99d99e","name":"","filename":"/home/pi/piScuttle/data2.csv","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":260,"y":200,"wires":[["3f6df30c.f1a0bc"]]},{"id":"ab78c8b0.7a8e18","type":"inject","z":"22de6241.99d99e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":120,"wires":[["d4cc4cd7.6b652"]]},{"id":"51721a8b.c03934","type":"mqtt out","z":"22de6241.99d99e","name":"","topic":"SCUTTLE/pi/gp2","qos":"2","retain":"","broker":"1cc0cc73.690154","x":470,
@dmalawey
dmalawey / robot_DM.PY
Last active June 26, 2020 00:18
change driving method to curve towards each waypoint. code in progress for robot.py
import time
import math
import logging
import numpy as np
from scuttlepy import gpio
from scuttlepy import wheels
from scuttlepy import mpu
# Create and configure logger
logging.basicConfig(filename="robotTest.log", format='%(asctime)s %(message)s', filemode='w')
@dmalawey
dmalawey / L2_displacement.py
Last active May 28, 2020 02:03
code for continuous counting of scuttle displacement
# l2_displacement.py
# This program takes the encoder values from encoders, computes wheel movement
# calculates the chassis displacement and continuously adds up the displacement
# to indicate how much the robot has advanced, in meters.
import L1_encoder as enc # local library for encoders
import numpy as np # library for math operations
import time # library for time access