rpi, static bags, EE, Node
11/15/20
(notes while learning basic EE and raspberry pi for the first time)
electricity / technoloogy
- it’s cool that industry standardized to phones that would charge from USB aka ~5V
- input amperage is how much current it draws from the wall: https://www.quora.com/Does-the-input-current-of-a-charger-matter
- 1 Megabit/s = 0.125 Megabytes/sec
- difference between grounding self to avoid static damage to electronics vs avoiding grounding self when working with dangerous levels of electricity
- NEVER operate with something unless its physically disconnected from elec. in this case, ran
sudo shutdown -h now
, then was connecting wires, but didnt realize that due to a software bug it was still frozen but on
static bags
- anti static: prevents buildup by being highly resistive (?)
- “Resistivity generally between 109 and 1012 ohms per square. Initial electrostatic charges are suppressed. May be surface resistive, surface-coated or filled throughout.”
- static dissipative: slowly discharges, so protects from buildup, but does NOT protect from ESD
- “Resistivity generally between 106 and 109 ohms per square. Low or no initial charges – prevents discharge to from human contact. May be either surface-coated or filled throughout”
- static shielding: faraday cage that protects from buildup AND ESD
- inner layer: static dissipative
- middle: aluminum shielding
- outer layer: static dissipative
- Links
- https://www.gotopac.com/art-esd-resistivity
- https://www.antistat.com/blog/2019-01/pink-anti-static-bags-or-esd-shielding-bags-whats-the-right-choice-for-me/
- https://coolcomponents.us/blogs/news/what-is-an-anti-static-bag-how-do-they-work-and-why-are-they-used-with-sensitive-electronics
- https://blog.gotopac.com/2017/11/14/are-anti-static-bags-conductive-whats-the-difference-between-anti-static-and-static-shielding-bags/#Is_a_Pink_AntiStatic_Bag_the_Same_as_a_Static_Dissipative_Bag
- https://www.build-electronic-circuits.com/what-is-ground/
- gnd is different from wall GND to circuit GND?
- “drawing as much current as it needs” is decided by electronics, but not all beahve that way
- https://electronics.stackexchange.com/questions/252036/do-the-statements-circuits-components-will-only-draw-the-current-they-need-an
Pi
- Node is very slow on pi zero
- setting image quality to 20 makes it 1 pic every ~6 seconds
- can still connect if pi is on 2.4 internet and your computer is on 5. because everything expsoed within the LAN?
- https://raspberrypi.stackexchange.com/questions/63519/power-consumption-of-pi-zero-w
- power usage 230mA with camera running
- treat as 400 with node
- https://raspberrypi.stackexchange.com/questions/101091/battery-usage-pi-zero-w-for-video-stream
- wifi 170, camera 230, total 400, treat as 500 due to continual running. last for 1 night, 8 hours, is 500 * 8 = >4000 mAh total charge used, assuming that it will reach full charge after sleeping
- power usage 230mA with camera running
- power consumptiono: mA is a rate, but since voltage steady used to discuss amount of energy in battery
- automat
- pi 4 doesnt work with 2.4ghz wifi even though it says it does
Ring
- teardown: https://www.youtube.com/watch?v=nY9WY70k9N4
Unix/Linux
check on a PID
- use
kill -0 $pid
to see if it exists (0 sends a blank signal to it, not interrupt) - see its open
fd
s at/proc/$pid/{status, otherFiles}
- or
lsof -a -p $PID
https://www.cyberciti.biz/faq/linux-find-all-file-descriptors-used-by-a-process/ echo outputs arguments
- or
watch systemctl status output
journalctl -f -u start-guardian.service
learned about sshh keys
- how to save ssh key? https://superuser.com/questions/8077/how-do-i-set-up-ssh-so-i-dont-have-to-type-my-password
-
how does having multiple keys affect security? https://superuser.com/questions/287651/can-i-have-multiple-ssh-keys-in-my-ssh-folder#:~:text=Yes%20you%20can%20have%20different%20ssh%20keys.&text=GitHub%20%2D%20Multiple%20SSH%20Keys.,appropriate%20key%20will%20be%20used.
- see info about running processes
-
ps aux
https://www.cyberciti.biz/faq/how-to-check-running-process-in-linux-using-command-line/ dmesg
shows current boot loogs- first line is “Booting Linux”
Node
createWriteStream should listen for open
awaiting a promise that resolves
node event loop–thats why it doesnt exit, waiting for callbacks
unhandledRejection vs unhandledException
- logStream automatically closed. are others?
- running debugger to see if writestream truly only makes one handler.
- Seems there’s 5 open at a time with process._getActiveHandles:
(5) [WriteStream, WriteStream, TLSSocket, TLSSocket, ReadStream] 0:WriteStream {connecting: false, _hadError: false, _parent: null, _host: null, _readableState: ReadableState, …} 1:WriteStream {connecting: false, _hadError: false, _parent: null, _host: null, _readableState: ReadableState, …} 2:TLSSocket {_tlsOptions: {…}, _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, …} 3:TLSSocket {_tlsOptions: {…}, _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, …} 4:ReadStream {connecting: false, _hadError: false, _parent: null, _host: null, _readableState: ReadableState, …}
- but log() says:
There are 2 handle(s) keeping the process running: guardian-src/dev-build/node_modules/ why-is-node-running/index.js:36 guardian-src/dev-build/node_modules/why-is-node-running/index.js:45 # WRITEWRAP guardian-src/dev-build/node_modules/why-is-node-running/index.js:46 (unknown stack trace) guardian-src/dev-build/node_modules/why-is-node-running/index.js:49 (undefined) # WRITEWRAP guardian-src/dev-build/node_modules/why-is-node-running/index.js:45 (unknown stack trace) guardian-src/dev-build/node_modules/why-is-node-running/index.js:46
- oh? try process._getActiveHAndles() in debugger again, and
(2) [WriteStream, WriteStream] 0:WriteStream {connecting: false, _hadError: false, _parent: null, _host: null, _readableState: ReadableState, …} 1:WriteStream {connecting: false, _hadError: false, _parent: null, _host: null, _readableState: ReadableState, …}
- Seems there’s 5 open at a time with process._getActiveHandles:
Internet
- IP address of smart bulbs
- https://community.lifx.com/t/bulb-ip-adress/1459
- hostname conflict
Nov 23 01:02:46 sentinelpi avahi-daemon[255]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.12. Nov 23 01:02:46 sentinelpi dhcpcd[290]: wlan0: adding route to 192.168.0.0/24 Nov 23 01:02:46 sentinelpi avahi-daemon[255]: New relevant interface wlan0.IPv4 for mDNS. Nov 23 01:02:46 sentinelpi avahi-daemon[255]: Registering new address record for 192.168.0.12 on wlan0.IPv4. Nov 23 01:02:46 sentinelpi dhcpcd[290]: wlan0: adding default route via 192.168.0.1 Nov 23 01:02:46 sentinelpi avahi-daemon[255]: Withdrawing address record for 192.168.0.12 on wlan0. Nov 23 01:02:46 sentinelpi avahi-daemon[255]: Host name conflict, retrying with sentinelpi-2 Nov 23 01:02:46 sentinelpi avahi-daemon[255]: Registering new address record for 192.168.0.12 on wlan0.IPv4.
programming
- python function decorators
soldering
https://www.youtube.com/watch?v=Qps9woUGkvI
psychology
- interesting effect of the camera on the ground is that people purposely place packages in front of it
random thoughts
10/29
- software is simply stitched together logic, with higher probability in some cases of working, based on how the world’s organized. who says email with link and password should work? strong assumptions that person has the connection of “link from email -> can open in browser properly” works
- auth could be connected in any other way