Use the device to connect the TimerCAM/Unit CAM through the GROVE interface to achieve command control of the camera's UART transmission of images and preview them on the M5CORE screen, or configure a timed shooting and upload to the cloud function (returning a fixed HTTP API).
M5Stack
or USB Serial
. Windows recommends using the driver files directly in the device manager for installation (custom update). The executable file installation method may not work properly.)
Click here to download the FTDI driver
For MacOS users, before installation, please check System Preferences
-> Security & Privacy
-> General
-> Allow apps downloaded from:
-> App Store and identified developers
option.
Please download the M5Burner firmware burning tool according to your operating system. Unzip and open the application.
Software Version | Download Link |
---|---|
M5Burner_Windows | Download |
M5Burner_MacOS | Download |
M5Burner_Linux | Download |
UIFlow supports configuring the camera to switch between UART
and Wi-Fi
working modes. The Wi-Fi mode supports timed shooting and automatically uploading images to the M5 cloud and returning an image call interface (URL). In UART mode, it supports users "to obtain image frames through UART communication with other main control devices" and modifying image parameters. The following will use the main control CORE as an example, connect UnitCAM, and obtain image data.
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
timercam_0 = unit.get(unit.UNITCAM, unit.PORTB)
unitcam_0 = unit.get(unit.UNITCAM, unit.PORTB)
timercam_token = None
def buttonA_wasPressed():
global timercam_token
timercam_0.set_wifi('xxxxx', 'xxxxx')
timercam_0.set_upload_time(5)
timercam_0.set_mode(timercam_0.CLOUD_MODE)
pass
btnA.wasPressed(buttonA_wasPressed)
def buttonB_wasPressed():
global timercam_token
timercam_token = timercam_0.get_token()
if timercam_token:
lcd.qrcode(('camera.m5stack.com/timer-cam/image?tok=' + timercam_0.get_token()), x=72, y=32, width=176, version=6)
pass
btnB.wasPressed(buttonB_wasPressed)
def buttonC_wasPressed():
global timercam_token
timercam_0.set_show(True)
timercam_0.set_image_size(timercam_0.SIZE_320_240)
timercam_0.set_mode(timercam_0.UART_MODE)
pass
btnC.wasPressed(buttonC_wasPressed)
timercam_0.set_wifi('ssid', 'password')
timercam_0.set_upload_time(5)
timercam_0.set_upload_time(5)
'camera.m5stack.com/timer-cam/image?tok=' + timercam_0.get_token()
timercam_0.set_mode(timercam_0.UART_MODE)
timercam_0.set_mode(timercam_0.CLOUD_MODE)
timercam_0.set_image_size(timercam_0.SIZE_320_240)
timercam_0.set_position(0, 0)
timercam_0.set_led_brightness(1024)