-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhw_research.txt
108 lines (80 loc) · 4.12 KB
/
hw_research.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
assuming 360 slices
100 LEDs/m (1.15m o'all diameter) 24V supply, 18W/m
https://www.superlightingled.com/dense-tm1824-sk6812-4040-rgbw-digital-addressable-led-strip-10m-no-voltage-drop-p-5872.html
mA per element?
I2C
SDA is not inverted! 0 is low
bit checked on falling edge of SCL
bus voltage:
pi is 3.3V, the screen I have is 5V. Seems to be OK?
Not sure if the screen is sending back any real data, reading any data address returns that address.
So all the slave has to do is pull SDA low to ACK.
https://raspberrypi.stackexchange.com/questions/68172/i2c-bus-voltage
i2cdetect, i2cdump, i2cget, i2cset:
--> manufacturer may report address as 8 bits OR 7-bits. 8-bit addresses will be 2x 7-bit addresses (with the read bit possibly set). So potentially, 0x79 == 0x27 (linux i2c tools use 7-bit addresses with the read bit set)
--> look for a /dev/i2c-0 or /dev/i2c-1
--> pass -y to override "do you want to proceed Y/n..." prompt
--> send many blocks at once by ending the sequence with "i"
i2c i/o expander chip:
https://www.ti.com/lit/ds/symlink/pcf8574.pdf
enable i2c from command line (or check status without opening raspi-config):
$ sudo raspi-config nonint get_i2c
--> 0 is on, 1 is off
$ sudo raspi-config nonint do_i2c 0
RPI
shell into raspberry pi with an ethernet cable ([] need to find ip address first)
https://raspberrypi.stackexchange.com/questions/3867/ssh-to-rpi-without-a-network-connection
$ crontab -l
...
@reboot /home/pi/startup.sh
...
(not sure how it was added)
RPI-ONLY PACKAGES:
add to webpack.config.js:
...
externals: {
'rpio': /^rpio$/,
'rpi-ws281x-native': /^rpi-ws281x-native$/
},
...
npm i $PACKAGE_NAME (don't run as root, root can't run mkdir inside node_modules for some reason)
prints a '?'
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x0C 0x08 i
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x09 0x3D 0x09 i
both of these set 4-bit mode and print a 'W'
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x28 0x28 0x2C 0x28 0x08 i ; set four-bit mode
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x28 0x28 0x2C 0x28 0x08 i ; set four-bit mode again
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x08 0x08 0x0C 0x08 0x08 i ; ^
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x08 0x08 0x0C 0x08 0x08 i ; turn on display
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0xf8 0xf8 0xfC 0xf8 0x08 i ; ^
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x09 0x59 0x59 0x5d 0x59 0x09 i ; W (0x57)
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x09 0x79 0x79 0x7d 0x79 0x09 i ; ^
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x2C 0x28 i ; set four-bit mode
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x2C 0x28 i ; set four-bit mode, 2 line mode (upper), [0, 0, 1, data length=0]
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x8C 0x88 i ; (lower) [lines=1, font=0, X, X]
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x0C 0x08 i ; turn on display (upper)
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0xfC 0xf8 i ; (lower) [1, display=1, cursor=1, blink=1]
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x09 0x5d 0x59 i ; W (upper)
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x09 0x7d 0x79 i ; W (lower)
this one didn't work (I think the time the data is exposed is too short):
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x28 0x2C 0x28 0x08 i
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x28 0x2C 0x28 0x08 i
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x08 0x0C 0x08 0x08 i
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0x08 0x0C 0x08 0x08 i
pi@raspberrypi:~ $ i2cset -y 1 0x27 0x08 0xf8 0xfC 0xf8 0x08 i
TIME CRAWLS LIKE AN ARROW (FUNCTION)
for loop: 218ms
named func inside for loop: 443ms
anon arrow func inside map: 2133ms
named function inside map: 2039ms
code: arrow_test.js
SSH TUNNEL FOR REMOTE DEBUGGER
ssh -L 9229:localhost:9229 [email protected]
I'm not totally sure which endpoint the port numbers are for, or which is the localhost
PROVISIONING A NEW PI FOR OMMATIDIA
$ sudo systemctl set-default multi-user.target [1]
enable I2C (text) and SPI (sound) in raspi-config
add the startup script to crontab
1. removes a bunch of graphical display things. reverse with https://raspberrypi.stackexchange.com/questions/90380/turning-off-lxpanel-on-raspberry-pi-says-cant-connect-to-display
OLD TESTAMENT STYLE
how do I kill a process and all its children?