Camera: AliExpress LTIA‐37FJZ (Vanhua Z55 module) - themactep/thingino-firmware GitHub Wiki
These modules/cameras have no SD card or USB interface. They must be flashed by UART serial connection or via TFTP upload. This article will provide a generalized procedure to flash these cameras. For this example a noname camera from AliExpress built with Vanhua Z55 module is flashed from an Ubuntu host.
some Aliexpress vendors:
https://www.aliexpress.com/store/3631127
https://www.aliexpress.com/store/2883177
(choose "Ingenic IP camera" category, then select a camera with the features you want:
- Ingenic chip model
- sensor model and resolution
- wide or narrow lens (mm)
- LAN with PoE or without PoE
- IP65 indoor or IP66 outdoor
- illumination (white, IR 850nm, IR 940nm, LDR, etc)
Note that there are models where LEDs can be controlled by thingino, and there are models where LEDs is controlled independently by an LDR (light detector) using direct analog hardware loop and the LED cannot be controlled by thingino.
Before you buy one check that it is a supported camera. This one is a 4MP T31X+GC4653 POE
What you will need:
- a USB-TTL UART adapter, a CH340A programmer was used. make sure it is NOT 5V.
- small cleqee clips, 24ga wire was soldered on
- serial program, minicom was used
- USB data cable to the UART adapter
- something conductive to short the pins of the flash chip
- the appropriate camera firmware, you should verify the download
Install minicom
sudo apt-get install minicom
Connect UART adapter to the camera, RX on adapter to TX on the camera, and TX on adapter to RX on the camera, GND to GND
- small clips are advised for the camera end if you haven't soldered before, the pads are extremely small
- the 3 holes under the heat sink are UART with TX being the closest to the corner, followed by RX and GND
- the CH340A is clearly labeled
Plug the UART adapter into your computer and start minicom
as superuser
sudo minicom
ctrl-a z
brings up the help menu. Change the tty device to /dev/ttyUSB0
and set the upload folder to where your bin
file is located.
Everything else works as default. Save as dtf? and exit menu.
Plug the camera in and you should see the camera boot on the screen if you are successful to this point. If the camera is not POE, make sure the Ethernet cable is attached.
Uploading the firmware
The flash chip is halfway under the heatsink. Pins 5 and 6 are toward the middle of the board by the 4 pin audio connector (see board picture above).
Unplug the camera then plug it in and within 1 to 2 seconds short pins 5 and 6 for 2-3 seconds until the camera loads into boot shell.
Copy and paste these commands one line at a time:
watchdog 0
setenv baseaddr 0x82000000
setenv flashsize 0x1000000
mw.b ${baseaddr} 0xff ${flashsize}
loady
At this point it should say ready to receive
Use ctrl-a z
then select s
, choose ymodem
, move down, and select the bin file with the spacebar, and hit enter.
After about 32 minutes it should say done. Hit any key to proceed.
Flashing the ROM
Copy and paste one line at a time
sf probe 0; sf erase 0x0 ${flashsize};
sf write ${baseaddr} 0x0 ${filesize}
Then enter reset
to reboot
Hopefully you have successfully installed Thingino, and you can find the camera IP on the UART display.
Login to the camera with the UART connection (default login for user root is root), set your password.
The camera IP should be displayed.
specs from vendor (right column):
variant (same PCB):
Getting night vision to work
I got a LTIA-65DJZ-AP from https://www.aliexpress.com/item/1005004371376288.html The T31N + GC2083. Its comes with a T31_F37_2L_V1_21 board in it.
I chose to use the Vanhua L34 Module because I think my board actually came with the T31L, not a T31N according to ipctool
.
This camera did not come with a light sensor and the white light and IR LEDs are switched on and off via the PWM output of the chip.
1. Check if PWM is working:
By running pwm -c 0 -q
root@ing-vanhua-l34-4ace ~# pwm -c 0 -q
Error opening /dev/pwm, make sure pwm drivers are enabled: No such file or directory
If its working then skip to 3
2. Enable kernel PWM modules
echo "pwm_core" >> /etc/modules.d/pwm
echo "pwm_hal" >> /etc/modules.d/pwm
Reboot and then check again:
root@ing-vanhua-l34-4ace ~# pwm -c 0 -q
PWM Channel 0 Status:
Enabled: Disabled
Polarity: Normal
Duty: -1 ns
Period: -1 ns
3. Test out the lights
On this board there are 2 lights, white LED and IR LED each on a separate PWM channel. You can manually activate the lights by running:
pwm -c 0 -e -p 1 -P 1000000 -n 0 -x 1000000 -r 50000
The -c 0
is the channel. Now you should see the white lights on or the IR light. Switch it off by:
pwm -c 0 -d
Hopefully you were able to switch on and off the lights
4. Update daynight script to switch the IR LEDs on and off
Modify the daynight
script by:
vi /sbin/daynight
Look for the function named switch_to_day()
In that function you need to add the switch off command pwm -c 1 -d
:
switch_to_day() {
echo_info "Switching to day mode..."
pwm -c 1 -d
Next look for the function switch_to_night()
Then add the switch on command:
switch_to_night() {
echo_info "Switched to night mode"
pwm -c 1 -e -p 1 -P 1000000 -n 0 -x 1000000 -r 50000
Now test it out. You should have fully functioning night vision on your AliExpress camera with Thingino