Saturday, 5 April 2025

Node-red

 start node-red from command line

password is commented out from ~/.node-red/settings.js 

<IP address>:1880 (Using wifi address at present)

Start Dashboard from little square in top right hand corner (Is there a way to go stratight to dash board?)

Add it as a service

 

sudo systemctl enable nodered.service
 
Also
  • node-red-start - this starts the Node-RED service and displays its log output. Pressing Ctrl-C or closing the window does not stop the service; it keeps running in the background
  • node-red-stop - this stops the Node-RED service
  • node-red-restart - this stops and restarts the Node-RED service
  • node-red-log - this displays the log output of the service

remove service

sudo systemctl disable nodered.service

 ssh -l hammarbytp <Wifi IP address>

fox....

 
 
 
 


 

 

 

 



 


Saturday, 20 May 2023

SD Card Driver with Arduinio Fire Beetle ESP32-E

Pins 

18 - SCK

23 - MOSI

19 -MISO

2 - D9 - CS (Note Pin naming is against pin number not D number)

 

3.3V 

Gnd


Add Following to setup


#define GPIO_PIN 2
void setup(){
  pinMode(GPIO_PIN, OUTPUT); // change this to 53 on a mega  // don't follow this!!
  digitalWrite(GPIO_PIN, HIGH); // Add this line

Also not VCC provides 5 V so can be used to power other 5V devices as long as the logic is 3.3V

Wednesday, 25 May 2016

Wildlife Pi Cam

Plan

Build a wildlife camera

HW

Raspberry Pi B+
New SD card
Pi Cam V2 8MB
PIR Detector
GPIO Connectors
Container(tupperware box?)
Lenses

Optional:- LED's, Switch,Battery Pack(Mobile Phone Charger?[How Big]),WiFI adapter

Plan:-

Configure SD Card with Raspbian.
Add VNC
Setup WiFi Adapter?

Add Pi Cam - Test via command script
Build PIR Hardware via Breadboad(LED to show state?)
Detect PIR
Activate Camera when PIR signaled
Dropbox Interface?
Add switch(s), state LED's?(On, PIR activate, running? )
Fix LED's and PIR onto circuit board
Build into container and add battery(Test Battery life)

Build Bird feeder so camera and bird feeded stay constant range

Container

Waterproof,
Need to be easy to recharge battet


Dropbox interface;

will the WiFi have the range?
Every period copy images into Dropboc and upload to dropbox account(Delete? )
Alternative login via Wifi and download via FTP

PIR Code

import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN,GPIO.PUD_DOWN)         #Read output from PIR motion sensor
GPIO.setup(3, GPIO.OUT)         #LED output pin
i=0
while True:
    i=GPIO.input(11)  
    if i==0:                 #When output from motion sensor is LOW
        print "No intruders",i
        GPIO.output(3, 0)  #Turn OFF LED
        time.sleep(0.1)
    elif i==1:               #When output from motion sensor is HIGH
        print "Intruder detected",i
        GPIO.output(3, 1)  #Turn ON LED
        time.sleep(0.1)

Note  GPIO.PUD_DOWN, this seems to be important. Takes a while to time out too, so it won't be fast. Ultrasound?