Skip to content

Commit d2c887e

Browse files
author
cat101
committed
Updated instruction for Smartwares CIP-37210
1. Updated instructions to work with the newer releases of OpenIPC 2. Added GPIO settings to make it simpler for beginners
1 parent ccd154c commit d2c887e

File tree

1 file changed

+49
-19
lines changed

1 file changed

+49
-19
lines changed

en/device-smartwares-cip-37210.md

+49-19
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ sudo kill 230002
104104
```
105105
Power off the camera and also disconnect and reconnect your USB to TTL adapter. Now enter the following command and power on the camera:
106106
```sh
107-
./burn --chip hi3518ev200 --file=./uboot/u-boot-hi3518ev200-universal.bin --break; screen -L /dev/ttyUSB0 115200
107+
./burn --chip hi3518ev200 --file=./u-boot/u-boot-hi3518ev200-universal.bin --break && screen -L /dev/ttyUSB0 115200
108108
```
109109
Hit any key to stop autoboot and you are greeted by the OpenIPC u-boot shell!
110110
```sh
@@ -145,7 +145,7 @@ It anything goes wrong here, don't power off the device and ask the mentioned [T
145145
```sh
146146
run setnor16m
147147
```
148-
Now it's time for another reboot, so enter `reset` again and you'll be greeted like this:
148+
Now remove the SD cards and reboot, by entering `reset` again and you'll be greeted like this:
149149
```text
150150
Welcome to OpenIPC
151151
openipc-hi3518ev200 login: root
@@ -172,51 +172,81 @@ openipc-hi3518ev200 login: root
172172
Please visit https://openipc.org/sponsor/ to learn more. Thank you.
173173
```
174174

175-
There is no root password set, so don't forget to set it with `passwd` after the first login!
175+
The root password is `12345`. Don't forget to change it with `passwd` after the first login!
176176

177177
If you are struggling with this tutorial and still want to try OpenIPC on a Smartwares CIP-37210, you can [buy it with OpenIPC v2.2 firmware pre-installed at open collective](https://opencollective.com/openipc/contribute/wifi-camera-showme-by-openipc-44355).
178178

179179
## Connecting to wifi
180-
Now it's time to connect the camera to your 2.4 GHz Wi-Fi network. First of all, make sure that the firmware environment variables are set correctly. This is necessary so that `udhcpc` gets a DNS lease (because it is requesting `$ipaddr`) and the gateway is set correctly.
180+
Now it's time to connect the camera to your 2.4 GHz Wi-Fi network. First of all, make sure that the firmware environment variables are set correctly.
181+
182+
First set the network driver:
181183

182184
```sh
183-
fw_printenv ipaddr
184-
fw_printenv gatewayip
185-
fw_printenv netmask
185+
fw_setenv wlandev rtl8188fu-generic
186186
```
187-
Set the correct values according to your needs, for example:
187+
188+
Then the correct values according to your needs, for example:
188189
```sh
189-
fw_setenv ipaddr 10.42.42.42
190+
fw_setenv wlanssid guest
191+
fw_setenv wlanpass guest-password
190192
```
191-
The last step is to configure the wlan0 interface:
193+
194+
You can check the settings as folows:
192195
```sh
193-
vi /etc/network/interfaces
196+
fw_printenv wlandev
197+
fw_printenv wlanssid
198+
fw_printenv wlanpass
194199
```
195-
Delete or outcomment the eth0 block, the device doesn't have ethernet and the auto setting will slow down boot. Add the following lines to your interfaces file, alter your SSID and password accordingly.
196200

197-
```text
201+
The last step is to configure the wlan0 interface:
202+
```sh
203+
cat <<EOF > /etc/network/interfaces.d/wlan0
198204
auto wlan0
199205
iface wlan0 inet dhcp
200206
pre-up echo 3 > /sys/class/gpio/export
201207
pre-up echo out > /sys/class/gpio/gpio3/direction
202-
pre-up echo 1 > /sys/class/gpio/gpio3/value
208+
pre-up echo 1 > /sys/class/gpio/gpio3/value # GPIO3 is the WIFI power
203209
pre-up modprobe mac80211
204210
pre-up sleep 1
205-
pre-up insmod /lib/modules/4.9.37/extra/rtl8188fu.ko
211+
pre-up modprobe 8188fu
206212
pre-up sleep 1
207-
pre-up wpa_passphrase "YOUR_WIFI_SSID" "YOUR_PASSWORD" >/tmp/wpa_supplicant.conf
208-
pre-up sed -i '2i \\tscan_ssid=1' /tmp/wpa_supplicant.conf
213+
pre-up wpa_passphrase "\$(fw_printenv -n wlanssid)" "\$(fw_printenv -n wlanpass)" > /tmp/wpa_supplicant.conf
214+
pre-up sed -i 's/#psk.*/scan_ssid=1/g' /tmp/wpa_supplicant.conf
209215
pre-up ifconfig wlan0 up
210-
pre-up wpa_supplicant -B -Dnl80211 -iwlan0 -c/tmp/wpa_supplicant.conf
216+
pre-up wpa_supplicant -B -i wlan0 -D nl80211,wext -c /tmp/wpa_supplicant.conf
211217
pre-up sleep 3
212218
post-down killall -q wpa_supplicant
213219
post-down echo 0 > /sys/class/gpio/gpio3/value
214220
post-down echo 3 > /sys/class/gpio/unexport
221+
EOF
215222
```
216223

217-
No it's time to check whether it's working:
224+
Now it's time to check whether it's working:
218225
```sh
219226
ifup wlan0
220227
ip addr
221228
```
222229
Check whether you can ping and ssh into the camera. Reboot and check, if the camera connects automatically to your wifi network. Reassamble the camera, now it's time so say goodbye to UART and use ssh and the web interface. (The credentials are root and the password you set earlier.)
230+
231+
Finally, you should look at `/etc/majestic.yaml` and in particular set this sections as follows in order to have a correct GPIO mapping for nighmode and audio.
232+
233+
```yaml
234+
audio:
235+
enabled: true
236+
volume: 70
237+
srate: 8000
238+
codec: alaw
239+
outputEnabled: true
240+
outputVolume: 30
241+
speakerPin: 51
242+
speakerPinInvert: true
243+
nightMode:
244+
enabled: true
245+
irSensorPin: 62
246+
irSensorPinInvert: true
247+
irCutPin1: 64
248+
backlightPin: 63
249+
dncDelay: 30
250+
nightAPI: true
251+
irCutSingleInvert: false
252+
```

0 commit comments

Comments
 (0)