Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding pages from old wiki #6

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ export default defineConfig({
{
label: "Quick Start",
link: "/getting-started/quick-start/",
badge: { text: "WIP", variant: "caution" },
},
{
label: "FAQ",
link: "/getting-started/faq/",
},
{
label: "Roadmap",
link: "/getting-started/roadmap/",
Expand Down Expand Up @@ -74,9 +77,8 @@ export default defineConfig({
label: "Hardware",
items: [
{
label: "Supported Hardware",
label: "Supported Devices",
link: "/hardware/supported-devices/",
badge: { text: "WIP", variant: "caution" },
},
{
label: "Flashing Firmware",
Expand Down
293 changes: 293 additions & 0 deletions src/content/docs/getting-started/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,293 @@
---
title: Frequently Asked Questions
description: Frequently Asked Questions
---

### I have a camera which is not on the list of supported devices. Will you make it work for me?

The short answer is no.

If you have the skills and desire to make OpenIPC to work on the new hardware, we can share the knowledge we have.
If not, get yourself a supported camera.

### How can I tell what hardware is inside the camera before I buy it?

Most of the time you can't. Especially if it is a cheap Chinese clone of a clone of a rebranded camera.
For reputable name brands that go through certification of the hardware, there is a chance to look at the
inside the camera in the certification documents. Look for the FCC ID on the camera's box or case
and then look it up in the [FCC ID database](https://fccid.io/).

### Differences between Lite and Ultimate

- Amazon server support
- QR code recognition support (basic)
- iptables support (firewall)
- ZeroTier tunnel support
- MQTT (telemetry) support
- WiFi support
- lame (mp3) and libwebsockets support


### How to strip U-Boot Image wrapper header from a binary image

Sometimes vendor's firmware consists of binary images intended
for use with U-Boot image loader and prepended with headers in
[U-Boot Image wrapper format](https://formats.kaitai.io/uimage/).
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
```

### How to get into bootloader shell?

[There is a handful of ways to get access to a locked bootloader shell](help-uboot.md#bypassing-password-protected-bootloader)

### How to reset camera settings from U-Boot

Sometimes improper settings make the camera unstable to the point where it is
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__

```
sf probe 0; sf erase 0x750000 0xb0000; reset
```

> __only for 16MB flash partitioning__

```
sf probe 0; sf erase 0xd50000 0x2b0000; reset
```

### How to sign in into camera via SSH?

`ssh root@<camera_ip_address>`

There is _12345_ password by default.

### How to sign in into camera Web UI?

Open http://<camera_ip_address>:85/ and sign in using default username _root_
and default password _12345_. You will be asked to change the password after
successful login.

__Please note, it will also change your ssh root password!__

### How to reset password for SSH/Web UI?

Create a serial connection to the camera using a UART adapter and a terminal
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 0; sf erase 0x750000 0xb0000; reset
```

For a camera with 16MB flash chip, run

```bash
sf probe 0; sf erase 0xd50000 0x2b0000; reset
```

### How to find information about the camera hardware and software?

Sign in on camera via `ssh` and run `ipctool`.

### I don't see ipctool on camera. Why?

You don't see it because initially it is not there, but there is a shell
command of the same name.

_(Since it's a shell command, it won't work from Web Console in web UI.
Sign in to the camera via SSH and run the command in there.)_

When you run this command, the latest available version of `ipctool` utility
gets downloaded into `/tmp/` directory and runs from there. Since the utility
resides in `/tmp/`, it won't survive a reboot, thus won't take any useful space
on the camera afterwards.

If you need to know what is in the command, search for `ipctool` in the
`/etc/profile` file.

### How to replace the bootloader from Linux? A dangerous operation for dummies!

Commands are executed separately by each line with a wait for the end of execution.
The full name of the replacement bootloader and its availability can be checked [here][3]

Before running the commands, don't forget to enter the correct bootloader name!

```
export LOADER=u-boot-SOC-TYPE.bin
curl -k -L -o /tmp/${LOADER} https://github.com/OpenIPC/firmware/releases/download/latest/${LOADER}
flashcp -v /tmp/${LOADER} /dev/mtd0
flash_eraseall /dev/mtd1
```

### How to update the ancient as shit OpenIPC firmware?

Commands are executed separately by each line with a wait for the end of execution.
The first command updates a utility whose algorithm was changed in February 2023.
If you need to update the utility on T31 processors, please add the -mips suffix to the URL of the downloaded utility.
The second command updates the firmware components themselves.

```
curl -L -o /tmp/ipcinfo https://github.com/OpenIPC/ipctool/releases/download/latest/ipcinfo && chmod +x /tmp/ipcinfo; /tmp/ipcinfo -csF
curl -s https://raw.githubusercontent.com/OpenIPC/firmware/master/general/overlay/usr/sbin/sysupgrade | sh -s -- -k -r -n
```

### Is it possible to switch from “lite” to “ultimate” via “Over the Air”?

It depends on the board, generally you can try to split the ultimate image to the rootfs and overlay partition and then set the correct partition layout via uboot.
A 'blind' uboot setup is only supported on sigmastar.
Otherwise the only way to get it working without accessing uboot is to manually set the correct variables with fw_printenv and fw_setenv.

```
dd if=rootfs.squashfs of=mtd3.bin bs=1k count=5120
dd if=rootfs.squashfs of=mtd4.bin bs=1k skip=5120
flashcp mtd3.bin /dev/mtd3 -v
flashcp mtd4.bin /dev/mtd4 -v
```

### How to dump full firmware to an NFS share

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
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 [email protected]
```

__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 [email protected]
```

### Majestic

#### How to get a memory dump for debugging?

Enable and configure Core Dump in the menu **Majestic** > **Majestic Debugging**.

#### Camera image has a pink tint

You need to specify GPIO pins to control the infrared filter.
Settings for some cameras can be found in [this table][1].
If your camera is not in the table then you need to use [ipctool utility][2].

The OpenIPC firmware will automatically download the latest version of the
utility to the /tmp directory when `ipctool` is invoked first time.

On stock firmware, you will need to download the utility to the camera yourself
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
```

After the utility is downloaded to the camera, run the `ipctool gpio scan`
command in the terminal and open-close the camera lens a couple of times with
your palm.

Watch the output of ipctool to determine the pins responsible for controlling
the IR filter curtain.

Enter the values obtained in the settings for the night mode Majestic. If the
pink tint still persists, you may need to enable sensor signal inversion.

Don't forget to add the camera model and found GPIO values to the table!

#### Is it possible to display the data for setting the auto focus of lenses
instead of the current sample_af in the standard /metrics?

No, this is a difficult algorithm, it does not have a sense to run it this way.

#### Copy files from Linux system to camera

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 [email protected]:/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 [email protected]:/tmp/
```


[1]: https://openipc.org/wiki/en/gpio-settings.html
[2]: https://github.com/OpenIPC/ipctool/releases/download/latest/ipctool
[3]: https://github.com/OpenIPC/firmware/releases/tag/latest
Loading