mirror of https://github.com/OpenIPC/wiki.git
typos and markdown fixes
parent
32dac889eb
commit
c8b2451bc9
|
@ -0,0 +1,18 @@
|
|||
RTSP
|
||||
RTMP
|
||||
sysklogd
|
||||
bootloader
|
||||
UART
|
||||
bootable
|
||||
distro
|
||||
stopbit
|
||||
baudrate
|
||||
backfeeding
|
||||
Buildroot
|
||||
GPIO
|
||||
makefile
|
||||
makefiles
|
||||
defconfig
|
||||
rootfs
|
||||
ipctool
|
||||
ffplay
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"markdownlint.config": {
|
||||
"default": true,
|
||||
"MD003": false,
|
||||
"MD009": false,
|
||||
"MD007": { "indent": 2 },
|
||||
"MD012": { "maximum": 2},
|
||||
"MD022": false,
|
||||
"MD026": { "punctuation": ",;!" },
|
||||
"MD031": false,
|
||||
"MD032": false,
|
||||
"MD034": false,
|
||||
"MD040": false,
|
||||
"MD045": false,
|
||||
"MD050": false,
|
||||
"MD053": false,
|
||||
"no-hard-tabs": false
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
version: "0.2"
|
||||
ignorePaths: []
|
||||
dictionaryDefinitions:
|
||||
- name: technical
|
||||
path: .technical.dict
|
||||
addWords: true
|
||||
dictionaries:
|
||||
- technical
|
||||
words: []
|
||||
import: []
|
||||
enableFiletypes:
|
||||
- shellscript
|
||||
patterns:
|
||||
- name: markdown_code_block
|
||||
pattern: "/^\\s*```(.|\\n)+?^\\s*```/gm"
|
||||
- name: markdown_code_inline
|
||||
pattern: "/`[^`]*`/g"
|
||||
languageSettings:
|
||||
- languageId: markdown
|
||||
ignoreRegExpList:
|
||||
- markdown_code_block
|
||||
- markdown_code_inline
|
||||
- "/[A-Z]*/g"
|
||||
ignoreWords: []
|
|
@ -11,8 +11,9 @@ for that.
|
|||
### Create an ACME account:
|
||||
|
||||
__on camera:__
|
||||
```console
|
||||
$ uacme -y -v new
|
||||
|
||||
```bash
|
||||
uacme -y -v new
|
||||
```
|
||||
|
||||
### Give your camera a FQDN
|
||||
|
@ -24,20 +25,22 @@ be accessed over HTTPS.
|
|||
Create an account with any Domain Name Register and register a domain name, e.g. _mysuperduperdomain.com_.
|
||||
|
||||
Set up a DNS zone for that domain name and create a record for your camera in that domain zone.
|
||||
```
|
||||
|
||||
```console
|
||||
DNS Records
|
||||
mysuperduperdomain.com
|
||||
---------------------------------------
|
||||
Type Host IP Address TTL
|
||||
A ipc-001 75.123.45.555 600
|
||||
```
|
||||
|
||||
where `75.123.45.555` is your public IP address.
|
||||
|
||||
### Set up port forwarding if your camera is behind NAT.
|
||||
|
||||
Add port forwarding from port 80 of WAN interface to port 80 of your camera's local IP address.
|
||||
|
||||
```
|
||||
```console
|
||||
75.123.45.555:80 => 192.168.1.10:80
|
||||
```
|
||||
|
||||
|
@ -47,19 +50,22 @@ camera domain name to HTTP proxy.
|
|||
### Issue a certificate for your domain:
|
||||
|
||||
__on camera__:
|
||||
```console
|
||||
$ uacme -y -v -h /usr/share/uacme/uacme.sh -t EC issue ipc-001.mysuperduperdomain.com
|
||||
|
||||
```bash
|
||||
uacme -y -v -h /usr/share/uacme/uacme.sh -t EC issue ipc-001.mysuperduperdomain.com
|
||||
```
|
||||
|
||||
### Set up a local DNS record override
|
||||
|
||||
You can add an override record to `/etc/hosts` file on your machine
|
||||
```
|
||||
|
||||
```bash
|
||||
echo "192.168.1.10 ipc-001.mysuperduperdomain.com" >> /etc/hosts
|
||||
```
|
||||
|
||||
or you could create a record on your local DNS server like [pi.hole](https://pi-hole.net/)
|
||||
so that anyone using that DNS server could have secure access to the camera, too.
|
||||
|
||||
### Restart majestic and test access
|
||||
|
||||
Open your favorite web browser and go to https://ipc-001.mysuperduperdomain.com/
|
||||
Open your favorite web browser and go to <https://ipc-001.mysuperduperdomain.com/>
|
||||
|
|
|
@ -3,6 +3,9 @@ Building from sources
|
|||
|
||||
Before you start building your own firmware, make a few changes to your system.
|
||||
|
||||
General
|
||||
---
|
||||
|
||||
### Clone OpenIPC Firmware Git repository.
|
||||
```
|
||||
cd
|
||||
|
@ -13,7 +16,8 @@ cd openipc-firmware
|
|||
```
|
||||
|
||||
### Install required packages.
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo make install-deps
|
||||
```
|
||||
|
||||
|
@ -23,12 +27,13 @@ By default, Buildroot stores all downloaded files in `dl/` directory inside
|
|||
buildroot file tree.
|
||||
|
||||
OpenIPC building script creates a fresh buildroot file tree before every
|
||||
compilation, meaning either deletes all dosnloaded packages or copies them back
|
||||
compilation, meaning either deletes all downloaded packages or copies them back
|
||||
and forth prior and after creating a fresh setup.
|
||||
|
||||
You can set your own storage directory outside of the buildroot tree. Add the
|
||||
following piece of code to `.profile` file in your home directory:
|
||||
```
|
||||
|
||||
```bash
|
||||
BR2_DL_DIR="${HOME}/buildroot_dl"
|
||||
[ ! -d "$BR2_DL_DIR" ] && mkdir -p $BR2_DL_DIR
|
||||
export BR2_DL_DIR
|
||||
|
@ -36,7 +41,7 @@ export BR2_DL_DIR
|
|||
|
||||
Then, source the changes.
|
||||
|
||||
```
|
||||
```bash
|
||||
source ~/.profile
|
||||
```
|
||||
|
||||
|
@ -44,7 +49,8 @@ source ~/.profile
|
|||
|
||||
Building of a binary firmware for your IP camera is fairly easy. Just clone
|
||||
source code from the repository and run a provided script.
|
||||
```
|
||||
|
||||
```bash
|
||||
./building.sh
|
||||
```
|
||||
|
||||
|
@ -67,14 +73,14 @@ depending on your computer performance and selected target. If you want to
|
|||
speed up the process, make sure you use a computer with SSD rather than HDD as
|
||||
the process of compiling involves a lot of reading and writing. Faster CPU is
|
||||
also beneficial, and one cannot have too much RAM, either. You could even rent
|
||||
an online virtual server for a handfull of cents to compile your firmware with
|
||||
an online virtual server for a handful of cents to compile your firmware with
|
||||
the power of cloud computing.
|
||||
|
||||
The very first run is the longest as the script will download every source
|
||||
bundle required for successful compilation. Consequent runs will take a little
|
||||
less time.
|
||||
|
||||
After the compilation is done, you'll find the final binary kernel and rootfs
|
||||
After the compilation is done, you'll find the final binary kernel and `rootfs`
|
||||
image in `output/images/` directory.
|
||||
|
||||
```
|
||||
|
@ -140,7 +146,7 @@ Making changes and rebuilding a package
|
|||
---------------------------------------
|
||||
|
||||
Once you start tinkering with the packages you'll realize you need a way to
|
||||
rebuld only one particular package, without rebuilding the whole project.
|
||||
rebuild only one particular package, without rebuilding the whole project.
|
||||
Is it even possible? Fortunately, yes. All you have to do after making changes
|
||||
to the package configs is to run a couple of commands:
|
||||
```
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
|
||||
> "Improving the world, one patch at a time."
|
||||
|
||||
Guidelines
|
||||
---
|
||||
|
||||
### This is an open project, so you can help, too.
|
||||
|
||||
We try to collect, organize and share as much information regarding different
|
||||
|
@ -10,7 +13,7 @@ aspects of the project as we can. But sometimes we overlook things that seem
|
|||
obvious to us, developers, but are not so obvious to end-users, people who are
|
||||
less familiar with nuts and bolts behind the scene. That is why we set up this
|
||||
wiki and let anyone having a GitHub account to make additions and improvements
|
||||
to the knowledgebase.
|
||||
to the knowledge base.
|
||||
|
||||
### How to contribute.
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
FFMPEG, RTSP and SRT examples
|
||||
-----------------------------
|
||||
|
||||
```
|
||||
```bash
|
||||
# Copy from file to file
|
||||
./ffmpeg -re -i z_input.mp4 -c copy z_output.mp4
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@ Interesting tricks
|
|||
------------------
|
||||
|
||||
### Sharing output of a command via web
|
||||
```
|
||||
|
||||
```bash
|
||||
<command> | nc seashells.io 1337
|
||||
```
|
||||
|
||||
|
@ -108,4 +109,5 @@ index d64ff27..159336e 100644
|
|||
G.logFileSize = xatou_range(opt_s, 0, INT_MAX/1024) * 1024;
|
||||
--
|
||||
```
|
||||
|
||||
_from [sysklogd: add -Z option to adjust message timezones](http://lists.busybox.net/pipermail/busybox/2017-May/085437.html)_
|
||||
|
|
|
@ -80,7 +80,6 @@ At the bottom of the mainboard:
|
|||

|
||||
|
||||
|
||||
|
||||
### GPIOs
|
||||
|
||||
| nr | Description |
|
||||
|
@ -517,7 +516,7 @@ sensors:
|
|||
## Flashing OpenIPC
|
||||
(soon...)
|
||||
|
||||
#### Boot dump
|
||||
### Boot dump
|
||||
```
|
||||
Uncompress Ok!
|
||||
|
||||
|
|
|
@ -192,23 +192,27 @@ Extract and copy `rootfs.squashfs.t31` `uImage.t31` to microSD card. Insert micr
|
|||
|
||||
Power on the camera.
|
||||
|
||||
During power on the camera press `Ctrl+C` several times until it shows OpenIPC promt like this `OpenIPC # `
|
||||
During power on the camera press `Ctrl+C` several times until it shows OpenIPC prompt like this `OpenIPC #`
|
||||
|
||||
Then issue command `run setnor16m`
|
||||
|
||||
After you press the Enter key the camera will almost immediately restart and you will have to catch the prompt again.
|
||||
|
||||
Then issue command
|
||||
Then issue command:
|
||||
|
||||
`mw.b ${baseaddr} ff 1000000; fatload mmc 0:1 ${baseaddr} uImage.${soc} ; sf probe 0; sf erase 0x50000 0x300000; sf write ${baseaddr} 0x50000 ${filesize}`
|
||||
```bash
|
||||
mw.b ${baseaddr} ff 1000000; fatload mmc 0:1 ${baseaddr} uImage.${soc} ; sf probe 0; sf erase 0x50000 0x300000; sf write ${baseaddr} 0x50000 ${filesize}
|
||||
```
|
||||
|
||||
and next
|
||||
and next:
|
||||
|
||||
`mw.b ${baseaddr} ff 1000000; fatload mmc 0:1 ${baseaddr} rootfs.squashfs.${soc} ; sf probe 0; sf erase 0x350000 0xa00000; sf write ${baseaddr} 0x350000 ${filesize}`
|
||||
```bash
|
||||
mw.b ${baseaddr} ff 1000000; fatload mmc 0:1 ${baseaddr} rootfs.squashfs.${soc} ; sf probe 0; sf erase 0x350000 0xa00000; sf write ${baseaddr} 0x350000 ${filesize}
|
||||
```
|
||||
|
||||
Output sample:
|
||||
|
||||
```
|
||||
```shell
|
||||
OpenIPC # mw.b ${baseaddr} ff 1000000; fatload mmc 0:1 ${baseaddr} uImage.${soc} ; sf probe 0; sf erase 0x50000 0x300000; sf write ${baseaddr} 0x50000 ${filesize}
|
||||
reading uImage.t31
|
||||
1855437 bytes read in 89 ms (19.9 MiB/s)
|
||||
|
@ -236,7 +240,7 @@ SF: 5079040 bytes @ 0x350000 Written: OK
|
|||
```
|
||||
If everything went well, issue the command `reset` and camera should start boot OpenIPC.
|
||||
|
||||
```
|
||||
```console
|
||||
Welcome to OpenIPC
|
||||
openipc-t31 login: root
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ or less.
|
|||

|
||||
|
||||
Throw in a silicone mat, a tube of no-clean flux, a can of solder paste,
|
||||
desoldering copper wick, ceramic tweezers, nonwoven swabs and a bottle
|
||||
de-soldering copper wick, ceramic tweezers, nonwoven swabs and a bottle
|
||||
of isopropyl alcohol. Many of these things can be already included as
|
||||
perks with the soldering station.
|
||||
|
||||
|
|
|
@ -4,8 +4,11 @@
|
|||
Run ipctool
|
||||
-----------
|
||||
|
||||
```
|
||||
```bash
|
||||
root@ipcam:/# ipctool
|
||||
```
|
||||
|
||||
```yaml
|
||||
---
|
||||
board:
|
||||
vendor: OpenIPC
|
||||
|
@ -53,5 +56,4 @@ sensors:
|
|||
bus: 0
|
||||
type: i2c
|
||||
addr: 0x30
|
||||
root@ipcam:/#
|
||||
```
|
||||
|
|
57
en/faq.md
57
en/faq.md
|
@ -1,7 +1,7 @@
|
|||
# OpenIPC Wiki
|
||||
[Table of Content](../README.md)
|
||||
|
||||
Frequesntly Asked Questions
|
||||
Frequently Asked Questions
|
||||
---------------------------
|
||||
|
||||
### How to strip U-Boot Image wrapper header from a binary image
|
||||
|
@ -12,11 +12,14 @@ for use with U-Boot image loader and prepended with headers in
|
|||
The header should be stripped off before you can use such an image
|
||||
as a raw binary file. Here's how you can strip the first 64 bytes
|
||||
from a file:
|
||||
```
|
||||
|
||||
```bash
|
||||
dd if=inputfile.img of=outputfile.bin bs=64 skip=1
|
||||
```
|
||||
|
||||
alternatively
|
||||
```
|
||||
|
||||
```bash
|
||||
tail -c +65 inputfile.img > outputfile.bin
|
||||
```
|
||||
|
||||
|
@ -31,11 +34,14 @@ impossible to log in or not enough time before rebooting to fix the settings.
|
|||
Here's how to completely erase the overlay partition in the OpenIPC firmware,
|
||||
right from the bootloader shell, to bring the camera back to its pristine state:
|
||||
|
||||
__only for 8MB flash partitioning__
|
||||
> __only for 8MB flash partitioning__
|
||||
|
||||
```
|
||||
sf probe 0; sf erase 0x750000 0xb0000; reset
|
||||
```
|
||||
__only for 16MB flash partitioning__
|
||||
|
||||
> __only for 16MB flash partitioning__
|
||||
|
||||
```
|
||||
sf probe 0; sf erase 0xd50000 0x2b0000; reset
|
||||
```
|
||||
|
@ -61,11 +67,14 @@ program. After turning on the camera, press Ctrl-C to interrupt the boot
|
|||
sequence and enter the bootloader shell.
|
||||
|
||||
For a camera with 8MB flash chip, run
|
||||
```
|
||||
|
||||
```bash
|
||||
sf probe; sf erase 0x750000 0xb0000; reset
|
||||
```
|
||||
|
||||
For a camera with 16MB flash chip, run
|
||||
```
|
||||
|
||||
```bash
|
||||
sf probe; sf erase 0xd50000 0x2b0000; reset
|
||||
```
|
||||
|
||||
|
@ -93,7 +102,8 @@ If you need to know what is in the command, search for `ipctool` in the
|
|||
|
||||
This could work if you are lucky, you gained access into Linux shell on stock
|
||||
firmware, and it does support NFS mounting:
|
||||
```
|
||||
|
||||
```bash
|
||||
fw=$(mktemp -t)
|
||||
nfs=$(dirname $fw)/nfs
|
||||
mkdir -p $nfs
|
||||
|
@ -101,46 +111,50 @@ mount -t nfs -o tcp,nolock 192.168.1.123:/path/to/nfs/share $nfs
|
|||
cat /dev/mtdblock? > $fw
|
||||
mv $fw ${nfs}/firmware_full.bin
|
||||
```
|
||||
|
||||
Make sure to use your own IP address and path to the NFS share!
|
||||
|
||||
### How to find original MAC address in a firmware dump
|
||||
|
||||
```
|
||||
```bash
|
||||
strings dumpfile.bin | grep ^ethaddr
|
||||
```
|
||||
|
||||
### How to configure ssh session authorization by key
|
||||
|
||||
__On the camera__: Sign in into web UI on port 85 of your camera.
|
||||
```
|
||||
|
||||
```bash
|
||||
passwd
|
||||
```
|
||||
|
||||
__On the desktop__: Copy the public key to the camera by logging in with the
|
||||
password created above.
|
||||
```
|
||||
|
||||
```bash
|
||||
ssh-copy-id root@192.168.1.66
|
||||
```
|
||||
|
||||
__On the camera__: Create a `.ssh` folder in the root user's home directory
|
||||
and copy the file with the authorized keystore into it.
|
||||
```
|
||||
|
||||
```bash
|
||||
mkdir ~/.ssh
|
||||
cp /etc/dropbear/authorized_keys ~/.ssh/
|
||||
```
|
||||
|
||||
__On the desktop__: Open a new session to verify that the authorization is
|
||||
passed using the public key not requesting a password.
|
||||
```
|
||||
|
||||
```bash
|
||||
ssh root@192.168.1.66
|
||||
```
|
||||
|
||||
|
||||
### Majestic
|
||||
|
||||
#### How to get a memory dump for debugging?
|
||||
|
||||
Enable and configure Core Dump in the menu Majestic > Majestic Debugging.
|
||||
Enable and configure Core Dump in the menu **Majestic** > **Majestic Debugging**.
|
||||
|
||||
#### Camera image has a pink tint
|
||||
|
||||
|
@ -156,16 +170,17 @@ using any tools available in the system: wget, curl, tftp etc.
|
|||
|
||||
For example, download the ipctool utility to TFTP server on the local network,
|
||||
then download it to the camera:
|
||||
```
|
||||
|
||||
```bash
|
||||
tftp -g -r ipctool -l /tmp/ipctool 192.168.1.1
|
||||
chmod +x /tmp/ipctool
|
||||
/tmp/ipctool
|
||||
|
||||
```
|
||||
|
||||
If the camera has access to the internet, you can try to mount a public NFS
|
||||
sharing and run the utility from it, without downloading to the camera:
|
||||
```
|
||||
|
||||
```bash
|
||||
mkdir -p /tmp/utils
|
||||
mount -o nolock 95.217.179.189:/srv/ro /tmp/utils/
|
||||
/tmp/utils/ipctool
|
||||
|
@ -193,19 +208,19 @@ No, this is a difficult algorithm, it does not have a sense to run it this way.
|
|||
Sometimes you need to transfer files to the camera. In addition to the above
|
||||
method using NFS (Network File System) you can use the standard Linux `scp`
|
||||
command to copy files over an SSH connection:
|
||||
```
|
||||
```bash
|
||||
scp ~/myfile root@192.168.1.65:/tmp/
|
||||
```
|
||||
This command will copy `myfile` from the home directory to the `/tmp/`
|
||||
directory on the camera.
|
||||
|
||||
On recent Linux systems the following error may occur:
|
||||
```
|
||||
```console
|
||||
sh: /usr/libexec/sftp-server: not found
|
||||
scp: Connection closed
|
||||
```
|
||||
In this case, add `-O` option to the command:
|
||||
```
|
||||
```bash
|
||||
scp -O ~/myfile root@192.168.1.65:/tmp/
|
||||
```
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ IPC Glossary
|
|||
- USB - Universal Serial Bus
|
||||
- WDR - Wide Dynamic Range
|
||||
|
||||
#### ffmpeg/ffplay
|
||||
### ffmpeg/ffplay
|
||||
|
||||
- PTS - Presentation Time Stamp
|
||||
- fps - Average frame rate in frames per second (`AVStream.avg_frame_rate`)
|
||||
|
|
|
@ -30,7 +30,7 @@ Board specific GPIO settings list
|
|||
| | | | | | |
|
||||
| T31 | 58 | 57 | | 49 | 61i | 53 | 55 | 56 | | 11 | 50 | 62 |
|
||||
|
||||
_i - inverted value_
|
||||
> _i - inverted value_
|
||||
|
||||
```
|
||||
Tested on Gk7205v200:
|
||||
|
@ -45,7 +45,6 @@ Tested on GK7205V200 for /dev/ttyАМА1
|
|||
```
|
||||
|
||||
|
||||
|
||||
### GSA boards
|
||||
|
||||
| Processor | IRCUT1 | IRCUT2 | IRSTATUS | IRCTL | USB_ENA |
|
||||
|
|
|
@ -53,8 +53,6 @@ _If you have another supported device to add, please do it [here][2]._
|
|||
| Zenotech | HI3516D_MB_V13_RA | HI3516DV100 | OV9689 | GD25Q128CSIG | Yes | No | | No |
|
||||
|
||||
|
||||
|
||||
|
||||
| Processor | Sensor | Vendor | SKU | Board identification |
|
||||
|-------------|------------------|------------|--------------|---------------------------------|
|
||||
| Hi3516Cv100 | IMX222_spi_dc | XM | | [BLK18C-0222-38X38_S-V1.03][1] |
|
||||
|
@ -99,7 +97,6 @@ _If you have another supported device to add, please do it [here][2]._
|
|||
| SSC338Q | IMX415 | CamHi/Xin | | SSC338Q_38M_1.1 |
|
||||
|
||||
|
||||
|
||||
[1]: https://openipc.org/supported-hardware
|
||||
[2]: https://github.com/OpenIPC/wiki/blob/master/en/guide-supported-devices.md
|
||||
[3]: https://github.com/OpenIPC/wiki/blob/master/en/device-chacon-ipcam-ri01.md
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# OpenIPC Wiki
|
||||
|
||||
[Table of Content](../README.md)
|
||||
|
||||
Hardware: IPC Board Manufacturers
|
||||
---------------------------------
|
||||
|
||||
* [ACTi](https://www.acti.com/)
|
||||
* [Anjvision](http://www.anjvision.com/), <http://icamra.cn/>
|
||||
* [Ansjer](https://www.ansjer.com/)
|
||||
|
@ -52,4 +54,4 @@ Hardware: IPC Board Manufacturers
|
|||
* [Zenotech](http://www.videopark.com.cn)
|
||||
* [ZOSI](https://www.zositech.com/)
|
||||
|
||||
_th? -- possibly a trading house_
|
||||
> _th? -- possibly a trading house_
|
||||
|
|
|
@ -26,7 +26,7 @@ With a sharp utility knife, cut the trace on the back of the programmer board.
|
|||

|
||||
|
||||
Connect 3.3v output leg of the voltage regulator to pin 9 of CH341A IC bridging
|
||||
it to a corresponding trace at a nerby capacitor.
|
||||
it to a corresponding trace at a nearby capacitor.
|
||||
|
||||

|
||||
|
||||
|
@ -37,28 +37,35 @@ of CH341A IC through 5V pin connector on the header.
|
|||
|
||||
### Troubleshooting
|
||||
|
||||
```
|
||||
```console
|
||||
libusb: error [get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/003, errno=13
|
||||
libusb: error [get_usbfs_fd] libusb requires write access to USB device nodes
|
||||
```
|
||||
|
||||
If you get an error message like this running a programming software, you need to adjust
|
||||
permissions on the USB port for that device.
|
||||
|
||||
Create a udev rule file
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo vi /etc/udev/rules.d/99-ch341a-prog.rules
|
||||
```
|
||||
|
||||
add the following content in the file:
|
||||
```
|
||||
|
||||
```bash
|
||||
# udev rule that sets permissions for CH341A programmer in Linux.
|
||||
# Put this file in /etc/udev/rules.d and reload udev rules or reboot to install
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE="0666"
|
||||
```
|
||||
|
||||
save the file, reload udev
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger
|
||||
```
|
||||
|
||||
then unplug the programmer and plug it back in a USB port.
|
||||
|
||||
### Software
|
||||
|
|
112
en/help-uboot.md
112
en/help-uboot.md
|
@ -4,43 +4,51 @@
|
|||
Help: U-Boot
|
||||
------------
|
||||
|
||||
### Prepare the enviroment
|
||||
### Prepare the environment
|
||||
In booloader shell, check if `baseaddr` variable is already defined.
|
||||
```
|
||||
|
||||
```bash
|
||||
printenv baseaddr
|
||||
```
|
||||
|
||||
If it is not there, set it yourself.
|
||||
```
|
||||
|
||||
```bash
|
||||
# Look up address for your SoC at https://openipc.org/supported-hardware/
|
||||
setenv baseaddr 0x80600000
|
||||
```
|
||||
|
||||
Assign the hex size of your flash chip to a variable called `flashsize`.
|
||||
```
|
||||
|
||||
```bash
|
||||
# Use 0x800000 for an 8MB flash chip, 0x1000000 for 16MB.
|
||||
setenv flashsize 0x800000
|
||||
```
|
||||
|
||||
Save these values into the environment afterwards.
|
||||
```
|
||||
|
||||
```bash
|
||||
saveenv
|
||||
```
|
||||
|
||||
### Saving original firmware without using TFTP.
|
||||
|
||||
Before you start, [prepare the enviroment](#prepare-the-enviroment).
|
||||
Before you start, [prepare the environment](#prepare-the-environment).
|
||||
|
||||
In the terminal program that you use to connect to the UART port, enable saving
|
||||
log file of the session. I like to use `screen` for this and my command for
|
||||
connect to the UART adapter with logging the active session to a file would look
|
||||
like this:
|
||||
```
|
||||
$ screen -L -Logfile fulldump.log /dev/ttyUSB0 115200
|
||||
|
||||
```bash
|
||||
screen -L -Logfile fulldump.log /dev/ttyUSB0 115200
|
||||
```
|
||||
|
||||
After connecting to the bootloader console, run a set of commands for reading
|
||||
whole amount of data from flash memory chip into RAM, and then dumping it as
|
||||
hexadecimal values into terminal window.
|
||||
|
||||
```
|
||||
```shell
|
||||
mw.b ${baseaddr} 0xff ${flashsize}
|
||||
sf probe 0
|
||||
sf read ${baseaddr} 0x0 ${flashsize}
|
||||
|
@ -58,7 +66,7 @@ Reading of an 8 MB flash memory should result in a ~40 MB log file, and for a
|
|||
Convert the hex dump into a binary firmware file and use it for further research
|
||||
or restoring camera to its pristine state.
|
||||
|
||||
```
|
||||
```bash
|
||||
cat fulldump.log | sed -E "s/^[0-9a-f]{8}\b: //i" | sed -E "s/ {4}.{16}\r?$//" > fulldump.hex
|
||||
xxd -revert -plain fulldump.hex fulldump.bin
|
||||
```
|
||||
|
@ -67,7 +75,7 @@ Use [binwalk](https://github.com/ReFirmLabs/binwalk) to unpack the binary file.
|
|||
|
||||
### Saving firmware via SD card.
|
||||
|
||||
Before you start, [prepare the enviroment](#prepare-the-enviroment).
|
||||
Before you start, [prepare the environment](#prepare-the-environment).
|
||||
|
||||
Sometimes your camera only has a wireless connection, which does not work
|
||||
directly from the bootloader. Very often such cameras have a microSD card slot.
|
||||
|
@ -94,14 +102,14 @@ blocks of 512 bytes, or 0x10 blocks in hexadecimal representation).
|
|||
|
||||
Example for 8MB:
|
||||
|
||||
```
|
||||
```shell
|
||||
mmc dev 0
|
||||
mmc erase 0x10 0x4000
|
||||
```
|
||||
|
||||
Example for a 16MB:
|
||||
|
||||
```
|
||||
```shell
|
||||
mmc dev 0
|
||||
mmc erase 0x10 0x8000
|
||||
```
|
||||
|
@ -113,7 +121,8 @@ the entire contents to the prepared space in RAM. Then export the copied data
|
|||
from RAM to the card.
|
||||
|
||||
Example for 8MB:
|
||||
```
|
||||
|
||||
```shell
|
||||
mw.b ${baseaddr} ff ${flashsize}
|
||||
sf probe 0
|
||||
sf read ${baseaddr} 0x0 ${flashsize}
|
||||
|
@ -122,7 +131,8 @@ mmc write ${baseaddr} 0x10 0x4000
|
|||
```
|
||||
|
||||
Another example, for 16MB:
|
||||
```
|
||||
|
||||
```shell
|
||||
mw.b ${baseaddr} ff ${flashsize}
|
||||
sf probe 0
|
||||
sf read ${baseaddr} 0x0 ${flashsize}
|
||||
|
@ -134,12 +144,14 @@ Remove the card from the camera and insert it into a computer running Linux.
|
|||
Use `dd` command to copy data from the card to a binary file on the computer.
|
||||
|
||||
Example for 8MB:
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo dd bs=512 skip=16 count=16384 if=/dev/sdc of=./fulldump.bin
|
||||
```
|
||||
|
||||
Example for 16MB:
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo dd bs=512 skip=16 count=32768 if=/dev/sdc of=./fulldump.bin
|
||||
```
|
||||
|
||||
|
@ -154,9 +166,11 @@ into the flash memory. Here's how.
|
|||
First of all, you'll need to install `lrzsz` package on your desktop computer.
|
||||
I presume it runs Linux and preferrably of a Debian family, that'll be easier
|
||||
on examples. So, run this command to satisfy prerequisites:
|
||||
```
|
||||
|
||||
```bash
|
||||
apt install lrzsz
|
||||
```
|
||||
|
||||
Now you are ready.
|
||||
|
||||
Place the binary file you are going to upload into the same directory where you
|
||||
|
@ -177,7 +191,7 @@ memory image right away using `bootm`, or write it into the flash memory.
|
|||
|
||||
### Flashing full image via serial connection
|
||||
|
||||
Before you start, [prepare the enviroment](#prepare-the-enviroment).
|
||||
Before you start, [prepare the environment](#prepare-the-environment).
|
||||
|
||||
Download the full firmware binary for your SoC and flash chip from
|
||||
[OpenIPC web site](https://openipc.org/supported-hardware/) after submitting the
|
||||
|
@ -186,20 +200,27 @@ settings form and clicking the link hidden under "Alternative method" button.
|
|||

|
||||
|
||||
Open `screen` and connect to UART port.
|
||||
```
|
||||
|
||||
```bash
|
||||
screen /dev/ttyUSB0 115200
|
||||
```
|
||||
|
||||
Sign in into bootloader shell and run:
|
||||
```
|
||||
|
||||
```shell
|
||||
mw.b ${baseaddr} 0xff ${flashsize}
|
||||
loady ${baseaddr}
|
||||
```
|
||||
|
||||
press "Ctrl-a" followed by ":", then type
|
||||
```
|
||||
|
||||
```bash
|
||||
exec !! sz --ymodem fullimage.bin
|
||||
```
|
||||
|
||||
after the image is loaded, continue
|
||||
```
|
||||
|
||||
```shell
|
||||
sf probe 0
|
||||
sf erase 0x0 ${flashsize}
|
||||
sf write ${baseaddr} 0x0 ${filesize}
|
||||
|
@ -207,26 +228,27 @@ sf write ${baseaddr} 0x0 ${filesize}
|
|||
|
||||
### Flashing full image from TFTP
|
||||
|
||||
Before you start, [prepare the enviroment](#prepare-the-enviroment).
|
||||
Before you start, [prepare the environment](#prepare-the-environment).
|
||||
|
||||
Download [full image binary for your SoC](https://openipc.org/supported-hardware/)
|
||||
and place it in the root directory of your local FTFP server.
|
||||
and place it in the root directory of your local TFTP server.
|
||||
|
||||
Start the session and boot into the bootloader console interrupting booting
|
||||
routine with a key combo. When in the console, set up parameters of your local
|
||||
network, if needed.
|
||||
|
||||
```
|
||||
```bash
|
||||
setenv ipaddr 192.168.1.10
|
||||
setenv netmask 255.255.255.0
|
||||
setenv gatewayip 192.168.1.1
|
||||
setenv serverip 192.168.1.254
|
||||
```
|
||||
|
||||
Use the following commands to reflash your camera with the full image:
|
||||
Use the following commands to re-flash your camera with the full image:
|
||||
|
||||
Example for 8MB:
|
||||
```
|
||||
|
||||
```shell
|
||||
mw.b ${baseaddr} 0xff ${flashsize}
|
||||
tftpboot ${baseaddr} openipc-${soc}-lite-8mb.bin
|
||||
sf probe 0; sf erase 0x0 ${flashsize}; sf write ${baseaddr} 0x0 ${filesize}
|
||||
|
@ -234,31 +256,34 @@ reset
|
|||
```
|
||||
|
||||
Example for 16MB:
|
||||
```
|
||||
|
||||
```shell
|
||||
mw.b ${baseaddr} 0xff ${flashsize}
|
||||
tftpboot ${baseaddr} openipc-${soc}-ultimate-16mb.bin
|
||||
sf probe 0; sf erase 0x0 ${flashsize}; sf write ${baseaddr} 0x0 ${filesize}
|
||||
reset
|
||||
```
|
||||
|
||||
At the first boot, sign in into the bootloader shell once again and remap
|
||||
partitioning running `run setnor16m` command.
|
||||
|
||||
|
||||
### Reading binary image from SD card.
|
||||
|
||||
Before you start, [prepare the enviroment](#prepare-the-enviroment).
|
||||
Before you start, [prepare the environment](#prepare-the-environment).
|
||||
|
||||
If your camera supports SD card and you have `fatload` command in bootloader,
|
||||
then you can read firmware binary files from an SD card.
|
||||
|
||||
First, prepage the card: format it into FAT filesystem and place bootloader,
|
||||
kernel, and rootsf binary files there. Insert the card into camera and boot
|
||||
First, prepare the card: format it into FAT filesystem and place bootloader,
|
||||
kernel, and rootfs binary files there. Insert the card into camera and boot
|
||||
into bootloader console.
|
||||
|
||||
Check that you have access to the card.
|
||||
```
|
||||
|
||||
```bash
|
||||
mmc rescan
|
||||
```
|
||||
|
||||
Then unlock access to flash memory and start writing content of the files from
|
||||
the card into the flash memory.
|
||||
|
||||
|
@ -267,7 +292,8 @@ necessarily match those for your particular camera. Consult documentation, or
|
|||
seek help on [our Telegram channel][telegram].
|
||||
|
||||
Flash bootloader.
|
||||
```
|
||||
|
||||
```shell
|
||||
mw.b ${baseaddr} 0xff 0x50000
|
||||
sf probe 0
|
||||
sf erase 0x0 0x50000
|
||||
|
@ -276,7 +302,8 @@ sf write ${baseaddr} 0x0 ${filesize}
|
|||
```
|
||||
|
||||
Flash kernel.
|
||||
```
|
||||
|
||||
```shell
|
||||
mw.b ${baseaddr} 0xff 0x200000
|
||||
sf probe 0
|
||||
sf erase 0x50000 0x200000
|
||||
|
@ -285,7 +312,8 @@ sf write ${baseaddr} 0x50000 ${filesize}
|
|||
```
|
||||
|
||||
Flash root filesystem.
|
||||
```
|
||||
|
||||
```shell
|
||||
mw.b ${baseaddr} 0xff 0x500000
|
||||
sf probe 0
|
||||
sf erase 0x250000 0x500000
|
||||
|
@ -352,23 +380,23 @@ __DO NOT FORGET TO MAKE A BACKUP OF YOUR ORIGINAL FIRMWARE!__
|
|||
|
||||
## Troubleshooting
|
||||
|
||||
Before you start, [prepare the enviroment](#prepare-the-enviroment).
|
||||
Before you start, [prepare the environment](#prepare-the-environment).
|
||||
|
||||
If you get `Too many args` error while trying to set an environment variable,
|
||||
try to do that from within Linux using `fw_setenv` instead of `setenv` in U-boot.
|
||||
|
||||
__U-boot console:__
|
||||
```
|
||||
|
||||
```shell
|
||||
hisilicon # setenv uk 'mw.b ${baseaddr} 0xff ${flashsize}; tftp ${baseaddr} uImage.${soc}; sf probe 0; sf erase 0x50000 0x200000; sf write ${baseaddr} 0x50000 ${filesize}'
|
||||
** Too many args (max. 16) **
|
||||
```
|
||||
|
||||
__OpenIPC Linux:__
|
||||
```
|
||||
|
||||
```shell
|
||||
root@openipc-hi3518ev100:~# fw_setenv uk 'mw.b ${baseaddr} 0xff ${flashsize}; tftp ${baseaddr} uImage.${soc}; sf probe 0; sf erase 0x50000 0x200000; sf write ${baseaddr} 0x50000 ${filesize}'
|
||||
```
|
||||
|
||||
|
||||
|
||||
[burn]: https://github.com/OpenIPC/burn
|
||||
[telegram]: https://t.me/OpenIPC
|
||||
|
|
|
@ -7,35 +7,35 @@ Help: Web UI
|
|||
### Updating Web UI from Web UI.
|
||||
|
||||
In some cases, especially if you think that something does not work as it should,
|
||||
try to update Web UI once more, overriding version checking for the second update.
|
||||
This may be required because of some changes we have possibly made to the updating
|
||||
routine, thus you shall retrieve the updating routine code with the first update,
|
||||
and then use it for the consecutive update.
|
||||
try to update Web UI once more, overriding version checking for the second update.
|
||||
This may be required because of some changes we have possibly made to the updating
|
||||
routine, thus you shall retrieve the updating routine code with the first update,
|
||||
and then use it for the consecutive update.
|
||||
|
||||
### Web UI Development.
|
||||
|
||||
If you want to help us with developing of the web interface for our
|
||||
firmware, here is what you need to know beforehands. Cameras are very
|
||||
limited in terms of space and performance. The only available option
|
||||
we have now in the firmware which is more or less suitable for dynamic
|
||||
generating of HTML pages is `haserl`, a fancy cousin of `ash` bent for
|
||||
serving as a CGI wrapper. Did I say `ash`? Right, because we don't have
|
||||
`bash`, `tcsh`, `zsh` in our Linux. Ash it is. As in A shell, full name
|
||||
Almquist shell. Tiny, lightweight, and kinda limited. System is limited,
|
||||
too -- in most parts it is `busybox`. So, if you still feel comfortable
|
||||
to make your hands dirty with a very 80s style of web development then
|
||||
welcome aboard.
|
||||
firmware, here is what you need to know beforehands. Cameras are very
|
||||
limited in terms of space and performance. The only available option
|
||||
we have now in the firmware which is more or less suitable for dynamic
|
||||
generating of HTML pages is `haserl`, a fancy cousin of `ash` bent for
|
||||
serving as a CGI wrapper. Did I say `ash`? Right, because we don't have
|
||||
`bash`, `tcsh`, `zsh` in our Linux. Ash it is. As in A shell, full name
|
||||
Almquist shell. Tiny, lightweight, and kinda limited. System is limited,
|
||||
too -- in most parts it is `busybox`. So, if you still feel comfortable
|
||||
to make your hands dirty with a very 80s style of web development then
|
||||
welcome aboard.
|
||||
|
||||
Recent interface is built around [Bootstrap](https://getbootstrap.com/)
|
||||
CSS framework which is a little overkill for the purpouse but allowed us
|
||||
to fasttrack from the original microbe web to what we have now. We would
|
||||
like to slim down the original Bootstrap bundle and create a custom pack
|
||||
with only the features we use. If you posses such a skill, come and work
|
||||
with us.
|
||||
CSS framework which is a little overkill for the purpose but allowed us
|
||||
to fast-track from the original microbe web to what we have now. We would
|
||||
like to slim down the original Bootstrap bundle and create a custom pack
|
||||
with only the features we use. If you posses such a skill, come and work
|
||||
with us.
|
||||
|
||||
Also, we're considering the possibility of switching to a client-side
|
||||
web interface builder, leaving only data-tossing to the server. Vue.js
|
||||
or similar. Have something to add here? Spill it out.
|
||||
web interface builder, leaving only data-tossing to the server. Vue.js
|
||||
or similar. Have something to add here? Spill it out.
|
||||
|
||||
Any other ideas? We would like to listen them, too.
|
||||
|
||||
|
@ -44,25 +44,26 @@ Any other ideas? We would like to listen them, too.
|
|||
To start improving the web interface, clone its GitHub repo locally and
|
||||
set up an NFS mount on your camera to the root directory of the local copy:
|
||||
|
||||
```
|
||||
```bash
|
||||
mkdir -p /tmp/dev
|
||||
mount -t nfs -o nolock,tcp 192.168.1.123:/full/path/to/web/files /tmp/dev
|
||||
```
|
||||
_(replace 192.168.1.123 and /full/path/to/web/files with your own IP and path)_
|
||||
|
||||
> _(replace 192.168.1.123 and /full/path/to/web/files with your own IP and path)_
|
||||
|
||||
Then start another instance of httpd daemon to serve your version of Web UI
|
||||
on another port of the camera, say port 86:
|
||||
on another port of the camera, say port 86:
|
||||
|
||||
```
|
||||
```bash
|
||||
httpd -p 86 -h "/tmp/dev/var/www" -c /dev/null
|
||||
```
|
||||
|
||||
Now you can work on Web UI source code in your favorite IDE or a text editor
|
||||
on your workstation, and immediately test the changes with a web browser
|
||||
pointed to port 86 on the camera. _(E.g. http://192.168.1.10:86/)_
|
||||
on your workstation, and immediately test the changes with a web browser
|
||||
pointed to port 86 on the camera. _(E.g. http://192.168.1.10:86/)_
|
||||
|
||||
Remember that you substitute only web server contents, but there are also
|
||||
supporting scripts residing outside web directory. These scripts might require
|
||||
updating on camera in case you make changes to them, as well. To update a
|
||||
script on camera, open ssh session to the camera and copy updated version of
|
||||
the script from `/tmp/dev/usr/sbin/` to `/usr/sbin/`.
|
||||
supporting scripts residing outside web directory. These scripts might require
|
||||
updating on camera in case you make changes to them, as well. To update a
|
||||
script on camera, open ssh session to the camera and copy updated version of
|
||||
the script from `/tmp/dev/usr/sbin/` to `/usr/sbin/`.
|
||||
|
|
Loading…
Reference in New Issue