Browse Source

en_all_update

liushuai 2 months ago
parent
commit
5bc9d01d92
41 changed files with 891 additions and 876 deletions
  1. 591 569
      main.py
  2. 2 2
      preset/app/01_camera.py
  3. 4 4
      preset/app/02_photoViewer.py
  4. 2 2
      preset/app/03_colorDetection.py
  5. 13 13
      preset/app/04_recorder.py
  6. 10 10
      preset/app/05_audioPlayer.py
  7. 1 1
      preset/app/07_videoPlayer.py
  8. 9 9
      preset/app/08_timeCounter.py
  9. 3 3
      preset/app/09_localTimeClock.py
  10. 4 4
      preset/app/10_servoControl.py
  11. 4 5
      preset/app/11_motorControl.py
  12. 2 2
      preset/app/12_pictureLoopPlay.py
  13. 2 2
      preset/app/13_qrCodeScanner.py
  14. 1 1
      preset/app/14_humanDetection.py
  15. 3 3
      preset/app/15_faceDetection.py
  16. 1 1
      preset/app/16_faceComparison.py
  17. 6 6
      preset/app/17_objectRecognition.py
  18. 3 3
      preset/app/18_edgeDetection.py
  19. 3 3
      preset/app/19_handWrittenDigiRecognition.py
  20. 3 3
      preset/app/20_carLicensePlateRecognition.py
  21. 3 3
      preset/app/21_maskDetection.py
  22. 2 2
      preset/app/22_gestureRecognition.py
  23. 3 3
      preset/app/23_fingerGuessing.py
  24. 16 20
      preset/app/24_connectWiFi.py
  25. 77 77
      preset/app/25_aboutCocoPi.py
  26. 6 6
      preset/app/26_internetCamera.py
  27. 14 13
      preset/app/27_internetWeatherPrediction.py
  28. 4 5
      preset/app/28_internetTimeClock.py
  29. 6 6
      preset/app/29_environmentDetection.py
  30. 13 13
      preset/app/30_training_data_collect.py
  31. 11 11
      preset/app/31_training_deploy_model.py
  32. 4 3
      preset/app/32_mnistModelTraining.py
  33. 2 2
      preset/app/33_mnistCameraTest.py
  34. 11 12
      preset/app/34_CocoGPT.py
  35. 3 3
      preset/app/35_CocoTerminal.py
  36. 9 3
      preset/app/36_pictureAnalysis.py
  37. 10 6
      preset/app/37_speechToImageSynthesis.py
  38. 1 1
      preset/app/38_jumpbot.py
  39. 2 14
      preset/app/git.py
  40. 4 4
      preset/app/ota.py
  41. 23 23
      preset/app/reset.py

+ 591 - 569
main.py

@@ -1,569 +1,591 @@
-#!/usr/bin/env python
-#version    :       2024.08.08
-#language   :       zh
-#hardware   :       pi
-import time
-from maix import *
-import gc
-import os,sys
-import sys
-sys.path.append('/root/')
-from CocoPi import BUTTON
-from CocoPi import stm8s
-from CocoPi import multiFuncGpio
-from CocoPi import singleRgb
-from CocoPi import LED
-
-gc.enable()
-gc.collect()
-iic_slaver=stm8s()
-iic_slaver.clear()
-PIXEL_LED1= multiFuncGpio(0,7)
-time.sleep(0.1)
-PIXEL_LED2= multiFuncGpio(1,7)
-PIXEL_LED1.pixelInit_()
-PIXEL_LED2.pixelInit_()
-time.sleep(0.1)
-L1=singleRgb()
-L1.setColor(0,0,0)
-L1.show()
-time.sleep(0.1)
-L2=LED()
-L2.out(0)
-del iic_slaver
-del PIXEL_LED1
-del PIXEL_LED2
-del L1
-del L2
-
-count = 0
-
-def gc_log():
-    global count
-    gc.collect()
-    count = count + 1
-
-splash_theme_color = (15,21,46)
-btn_selected = (255,255,255)
-btn_unselected = (76,86,127)
-txt_selected = (255,255,255)
-txt_unselected = (76,86,127)
-color_splash_theme = (15,21,46)
-color_blue = (31,61,185)
-color_blue_lighter = (60,131,211)
-color_white = (255,255,255)
-color_gray = (60,73,126)
-color_orange = (255,165,0)
-color_red = (255,0,0)
-
-
-btn_width = 134
-btn_height = 52
-btn_y_base = 5
-btn_col = (btn_y_base, btn_y_base+btn_width, btn_y_base+152)
-btn_row = 180
-
-main_title = (
-        "运行",
-        "上次程序",
-        "打开",
-        "样例菜单",
-        "B",
-        "A"
-    )
-splash_text = (
-        "系统版本: 2024-08-08 ",
-        "System version: N/A",
-        "2. 加载程序后,按下A键两秒退出程序界面.",
-        "    ",
-        "    ",
-        "启动上次程序中...",
-        "错误: 未找到程序...",
-        "错误: 语法有误",
-        "正在打开样例菜单...",
-        "未找到样例菜单.",
-        "运行",
-        "加载...",
-        "返回",
-        "按下C键返回主界面",
-        "按下D键重启",
-        "按下B键关机",
-        "1. 按下A键七秒来关闭或者重启CocoPi系统.",
-        "    ",
-        "    ",
-        "CocoPi V6",
-        "/ Linux / AIot /Python /",
-        "/Graphical programming /",
-        "------------- 基础 --------------",
-        "----------- 人工智能 ----------",
-        "------------ 物联网 ------------",
-    )
-
-title_logo_text = image.open("/root/preset/img/cocorobo_text.jpg")
-iconUpNp = image.open("/root/preset/img/arrow_up_filled.jpg")
-iconUpP = image.open("/root/preset/img/arrow_up_pressed.jpg")
-iconDownNp = image.open("/root/preset/img/arrow_down_filled.jpg")
-iconDownP = image.open("/root/preset/img/arrow_down_pressed.jpg")
-frostedGlass = image.open("/root/preset/img/frostedglass_.jpg")
-#backUp = image.open("/root/preset/img/backup_48x48.png")
-#powerOff = image.open("/root/preset/img/poweroff_48x48.png")
-#reBoot = image.open("/root/preset/img/reboot_48x48.png")
-
-run_user_code_path='/root/user_latest_code.py'
-run_try_demo_path='/root/play_music.py'
-
-
-key_A = BUTTON(14)
-key_B = BUTTON(8)
-key_C = BUTTON(13)
-key_D = BUTTON(7)
-
-splash = image.new(size=(320, 240),mode = "RGB")
-img_drop=image.new(size=(320,240),mode="RGB")
-
-demo_i=0
-demo_j=0
-demo_m=0
-demo_n=0
-pressTime=0
-systemRunNum=0
-
-image.load_freetype("/root/preset/fonts/simhei.ttf")
-def screenFirstPage():
-    from maix import display,image,camera
-    global splash,title_logo_text,btn_col,btn_row,splash_text,txt_unselected,txt_selected,btn_selected,btn_unselected,\
-splash_theme_color,btn_height,btn_width,main_title,menuSelect,gc_log,demo_i,demo_j,demo_m,demo_n,screenShow,img_drop,\
-frostedGlass
-    gc_log()
-    image.load_freetype("/root/preset/fonts/simhei.ttf")
-    splash.clear()
-    splash.draw_rectangle(0,0,320,320,color=splash_theme_color,thickness=-1)
-    splash.draw_image(title_logo_text, btn_col[0]+16, 10)
-    x, y = image.get_string_size(splash_text[0], 1)
-
-    splash.draw_string(btn_col[0]+16, 40, splash_text[19]+"  "+splash_text[0], color=(0,255,255), thickness = 1)
-#    splash.draw_string(btn_col[0], 60, splash_text[20], color=(0,255,255), thickness = 1)
-#    splash.draw_string(btn_col[0], 80, splash_text[21], color=(0,255,255), thickness = 1)
-#    splash.draw_string(btn_col[0], 60, splash_text[0], color=(0,255,255), thickness = 1)
-    splash.draw_string(btn_col[0]+16, btn_row-105, splash_text[16], color=txt_unselected, thickness = 1)
-    splash.draw_string(btn_col[0]+16, btn_row-85, splash_text[17], color=txt_unselected, thickness = 1)
-    #splash.draw_string(btn_col[0], btn_row-105, splash_text[18], color=txt_unselected, thickness = 1)
-    splash.draw_string(btn_col[0]+16, btn_row-65, splash_text[2], color=txt_unselected, thickness = 1)
-    splash.draw_string(btn_col[0]+16, btn_row-45, splash_text[3], color=txt_unselected, thickness = 1)
-    splash.draw_string(btn_col[0]+16, btn_row-25, splash_text[4], color=txt_unselected, thickness = 1)
-
-    if menuSelect==0:
-        splash.draw_rectangle(btn_col[1]+40, btn_row, btn_col[1]+btn_width+42, btn_row+btn_height, color=btn_selected, thickness=1)
-        splash.draw_string(btn_col[1]+52, btn_row+7, main_title[2], color=txt_selected, thickness = 1)
-        splash.draw_string(btn_col[1]+52, btn_row+27, main_title[3], color=txt_selected, thickness = 1)
-        splash.draw_string(btn_col[1]+157, btn_row+27, main_title[5], color=txt_unselected, thickness = 1)
-
-        splash.draw_rectangle(btn_col[0], btn_row, btn_col[0]+btn_width, btn_row+btn_height, color=btn_selected, thickness=1)
-        splash.draw_string(btn_col[0]+96, btn_row+7, main_title[0], color=txt_selected, thickness = 1)
-        splash.draw_string(btn_col[0]+68, btn_row+27, main_title[1], color=txt_selected, thickness = 1)
-        splash.draw_string(btn_col[0]+7, btn_row+27, main_title[4], color=txt_unselected, thickness = 1)
-
-    if menuSelect==1:
-        splash.draw_rectangle(btn_col[0], btn_row, btn_col[0]+btn_width, btn_row+btn_height, color=btn_unselected, thickness=1)
-        splash.draw_string(btn_col[0]+7, btn_row+7, main_title[0], color=txt_unselected, thickness = 1)
-        splash.draw_string(btn_col[0]+7, btn_row+27, main_title[1], color=txt_unselected, thickness = 1)
-
-        splash.draw_rectangle(btn_col[1], btn_row, btn_col[1]+btn_width, btn_row+btn_height, color=btn_selected, thickness=1)
-        splash.draw_string(btn_col[1]+7, btn_row+7, main_title[2], color=txt_selected, thickness = 1)
-        splash.draw_string(btn_col[1]+7, btn_row+27, main_title[3], color=txt_selected, thickness = 1)
-
-    splash.draw_image(frostedGlass, 0, 0,alpha=0.2)
-    #screenShow()
-    display.show(splash)
-
-def screenSecondPage():
-    from maix import display, image,camera
-    global splash,title_logo_text,btn_col,btn_row,splash_text,txt_unselected,txt_selected,btn_selected,btn_unselected,\
-splash_theme_color,btn_height,btn_width,main_title,demoSelect,gc_log,color_splash_theme,color_blue,color_blue_lighter,\
-color_white,color_gray,color_orange,color_red,iconUpNp,iconUpP,iconDownNp,iconDownP,demoListText,screenShow,img_drop,\
-frostedGlass
-    gc_log()
-    image.load_freetype("/root/preset/fonts/simhei.ttf")
-    splash.clear()
-    splash.draw_rectangle(0,0,320,240,color=splash_theme_color,thickness=-1)
-    splash.draw_rectangle(0,0,320,32,color=color_blue,thickness=-1)
-    splash.draw_image(iconUpNp, 3, 3)
-    splash.draw_image(iconDownNp, 287, 3)
-
-    splash.draw_rectangle(0,214,50,240,color=color_blue,thickness=-1)
-    splash.draw_rectangle(270,214,320,240,color=color_blue,thickness=-1)
-    splash.draw_string(12, 218, splash_text[10], color=(255,255,255), thickness = 1)
-    splash.draw_string(282, 218, splash_text[12], color=(255,255,255), thickness = 1)
-
-    demo_i=int(demoSelect/6)
-    demo_j=demoSelect%6
-    demo_m=int(demoNum/6)
-    demo_n=demoNum%6
-    for j in range(6):
-        if demo_i==demo_m:
-            if j>=demo_n:
-                pass
-            else:
-                if j==demo_j:
-                    pass
-                else:
-                    splash.draw_rectangle(0,33+30*j,319,33+30*(j+1),color=color_gray,thickness=1)
-                    splash.draw_string(8, 39+30*j,demoListText[j+demo_i*6] , color=color_gray, thickness = 1)
-        else:
-            if j==demo_j:
-                pass
-            else:
-                splash.draw_rectangle(0,33+30*j,319,33+30*(j+1),color=color_gray,thickness=1)
-                splash.draw_string(8, 39+30*j,demoListText[j+demo_i*6] , color=color_gray, thickness = 1)
-    if demoSelect<13:
-        splash.draw_string(72, 10, splash_text[22], color=(255,255,255), thickness = 1)
-    elif demoSelect<23:
-        splash.draw_string(72, 10, splash_text[23], color=(255,255,255), thickness = 1)
-    else:
-        splash.draw_string(72, 10, splash_text[24], color=(255,255,255), thickness = 1)
-    splash.draw_rectangle(0,33+30*demo_j,319,33+30*(demo_j+1),color=color_white,thickness=1)
-    splash.draw_string(8, 39+30*demo_j,demoListText[demoSelect] , color=color_white, thickness = 1)
-    splash.draw_string(146, 218, str(demoSelect+1), color=(255,255,255), thickness = 1)
-    splash.draw_string(160, 218, "/"+str(demoNum), color=(255,255,255), thickness = 1)
-    splash.draw_image(frostedGlass, 0, 0,alpha=0.2)
-    #screenShow()
-    display.show(splash)
-
-def systemPage():
-    from maix import display, image,camera
-    import time
-    global splash,title_logo_text,btn_col,btn_row,splash_text,txt_unselected,txt_selected,btn_selected,btn_unselected,\
-splash_theme_color,btn_height,btn_width,main_title,demoSelect,gc_log,color_splash_theme,color_blue,color_blue_lighter,\
-color_white,color_gray,color_orange,color_red,iconUpNp,iconUpP,iconDownNp,iconDownP,demoListText,screenShow,img_drop,\
-frostedGlass
-    image.load_freetype("/root/preset/fonts/simhei.ttf")
-    for i in range(10):
-        splash.draw_image(frostedGlass, 0, 0,alpha=0.2)
-        #screenShow()
-        display.show(splash)
-    splash.draw_string(80, 68, splash_text[13], 1,color=(0,255,0), thickness = 1)
-    splash.draw_string(80, 118, splash_text[14], 1,color=(255,255,0), thickness = 1)
-    splash.draw_string(80, 168, splash_text[15], 1,color=(255,0,0), thickness = 1)
-    #splash.draw_image(backUp, 20, 140)
-    #screenShow()
-    splash.draw_image((image.open("/root/preset/img/backup_00ff00_32x32.png")).rotate(0, adjust=0),40,60,alpha=1)
-    splash.draw_image((image.open("/root/preset/img/reboot_ffff00_32x32.png")).rotate(0, adjust=0),40,110,alpha=1)
-    splash.draw_image((image.open("/root/preset/img/poweroff_ff0000_32x32.png")).rotate(0, adjust=0),40,160,alpha=1)
-
-    display.show(splash)
-
-pageVal=0
-menuSelect=0
-demoSelect=0
-execVal=0
-demoListText=(
-    "相机",
-    "相册",
-    "颜色分析",
-    "录音机",
-    "音频播放器",
-    "播放演示音乐",
-    "播放演示视频",
-    "秒表计时器",
-    "系统时钟显示",
-    "舵机操控",
-    "电机操控",
-    "图片轮播",
-    "二维码扫描",
-    "人形识别",
-    "人脸检测",
-    "人脸比对",
-    "物体识别",
-    "边缘检测",
-    "手写数字识别",
-    "车牌识别",
-    "口罩识别",
-    "手势识别",
-    "猜拳识别",
-    "扫码连接WIFI",
-    "关于CocoPi",
-    "无线相机",
-    "网络天气",
-    "网络时钟",
-    "环境监测",
-    "模型训练:数据集采集",
-    "模型训练:模型部署",
-    "手写数字识别本地训练",
-    "手写数字识别即时训练模型测试",
-    "可可派-GPT",
-    "可可派-终端",
-    "图片分析",
-    "语音输入生成图片",
-    "跳跳机器人",
-    "贪吃蛇",
-    "声音响度分析",
-    "声音频谱分析",
-    "切换语言",
-    "检查更新",
-    "撤销更新",
-
-)
-demoNameList=(
-    "01_camera",
-    "02_photoViewer",
-    "03_colorDetection",
-    "04_recorder",
-    "05_audioPlayer",
-    "06_musicPlayer",
-    "07_videoPlayer",
-    "08_timeCounter",
-    "09_localTimeClock",
-    "10_servoControl",
-    "11_motorControl",
-    "12_pictureLoopPlay",
-    "13_qrCodeScanner",
-    "14_humanDetection",
-    "15_faceDetection",
-    "16_faceComparison",
-    "17_objectRecognition",
-    "18_edgeDetection",
-    "19_handWrittenDigiRecognition",
-    "20_carLicensePlateRecognition",
-    "21_maskDetection",
-    "22_gestureRecognition",
-    "23_fingerGuessing",
-    "24_connectWiFi",
-    "25_aboutCocoPi",
-    "26_internetCamera",
-    "27_internetWeatherPrediction",
-    "28_internetTimeClock",
-    "29_environmentDetection",
-    "30_training_data_collect",
-    "31_training_deploy_model",
-    "32_mnistModelTraining",
-    "33_mnistCameraTest",
-    "34_CocoGPT",
-    "35_CocoTerminal",
-    "36_pictureAnalysis",
-    "37_speechToImageSynthesis",
-    "38_jumpbot",
-    "39_gluttonousSnake",
-    "40_soundLoudnessAnalysis",
-    "41_soundSpectrumAnalysis",
-    "checkout",
-    "pull",
-    "reset",
-
-)
-demoNum=len(demoListText)
-pageSig=1
-selectSig=1
-def buttonDectect():
-    from maix import display, image,camera
-    import time
-    import os
-    global key_A,key_B,key_C,key_D,pageVal,menuSelect,execVal,demoNum,demoSelect,splash,iconUpP,iconDownP,screenShow,img_drop,systemRunNum,pageSig,selectSig
-
-    if(pageVal==0):
-        if(key_A.is_pressed()):
-            pressTime=time.perf_counter()
-            while key_A.is_pressed()==1:
-                if(time.perf_counter()-pressTime)<5:
-                    time.sleep(0.001)
-                    pageVal=1
-                else:
-                    pageVal=2
-                    break
-            execVal=0
-        elif(key_B.is_pressed()):
-            while key_B.is_pressed()==1:
-                time.sleep(0.001)
-            execVal=1
-#         elif (key_B.is_pressed()):
-#             while key_B.is_pressed()==1:
-#                 time.sleep(0.001)
-#             pageVal=1
-        else:
-            pass
-    elif(pageVal==1):
-        if execVal==0:
-            if(key_D.is_pressed()):
-                splash.draw_image(iconUpP, 3, 3)
-                #screenShow()
-                display.show(splash)
-                while key_D.is_pressed()==1:
-                    time.sleep(0.001)
-                demoSelect=demoSelect-1
-                if(demoSelect==-1):
-                    demoSelect=demoNum-1
-            elif (key_C.is_pressed()):
-                splash.draw_image(iconDownP, 287, 3)
-                #screenShow()
-                display.show(splash)
-                while key_C.is_pressed()==1:
-                    time.sleep(0.001)
-                demoSelect=demoSelect+1
-                if(demoSelect==demoNum):
-                    demoSelect=0
-            elif (key_B.is_pressed()):
-                while key_B.is_pressed()==1:
-                    time.sleep(0.001)
-                execVal=2+demoSelect
-            elif (key_A.is_pressed()):
-                while key_A.is_pressed()==1:
-                    time.sleep(0.001)
-                menuSelect=0
-                pageVal=0
-                demoSelect=0
-                execVal=0
-                try:
-                    with open( '/tmp/page.txt', 'w' ) as f:
-                        f.write(str(pageVal))
-                except:
-                    pass
-                try:
-                    with open( '/tmp/menu.txt', 'w' ) as f:
-                        f.write(str(demoSelect))
-                except:
-                    pass
-                pageSig=1
-                selectSig=1
-            else:
-                pass
-        else:
-            if (key_A.is_pressed()):
-                while key_A.is_pressed()==1:
-                    time.sleep(0.001)
-                menuSelect=0
-                pageVal=0
-                demoSelect=0
-                execVal=0
-                systemRunNum=0
-    elif pageVal==2:
-        if(key_C.is_pressed()):
-            pageVal=0
-            menuSelect=0
-            pageVal=0
-            demoSelect=0
-            execVal=0
-            systemRunNum=0
-        elif key_B.is_pressed():
-            os.system("poweroff")
-        elif key_D.is_pressed():
-            os.system("reboot")
-    else:
-        pass
-
-def running():
-    from maix import display, image,camera
-    global splash,title_logo_text,btn_col,btn_row,splash_text,txt_unselected,txt_selected,btn_selected,btn_unselected,\
-splash_theme_color,btn_height,btn_width,main_title,menuSelect,pageVal,execVal,screenFirstPage,screenSecondPage,\
-color_splash_theme,color_blue,color_blue_lighter,color_white,color_gray,color_orange,color_red,demo_i,demo_j,\
-demo_m,demo_n,screenShow,img_drop,systemRunNum,systemPage,demoNameList,pageSig,selectSig,demoSelect
-    if pageSig==1:
-        try:
-            with open( '/tmp/page.txt', 'r' ) as f:
-                pageVal=int(f.read())
-                print(pageVal)
-            pageSig=0
-        except:
-            pass
-    if selectSig==1:
-        try:
-            with open( '/tmp/menu.txt', 'r' ) as f:
-                demoSelect=int(f.read())
-                print(demoSelect)
-            selectSig=0
-        except:
-            pass
-
-    if(pageVal==0):
-        screenFirstPage()
-        if(execVal==0):
-            pass
-            #splash.draw_rectangle(btn_col[0], btn_row-26,btn_col[0]+220,26, color=splash_theme_color, thickness=1)
-            #screenShow()
-            #display.show(splash)
-        else:
-            try:
-                splash.draw_string(btn_col[0], btn_row-25, splash_text[5], color=(0,255,255),thickness = 1)
-                #screenShow()
-                display.show(splash)
-                time.sleep(0.5)
-                os.system("ln -sf %s /tmp/event && touch /tmp/start" % "/root/user_latest_code.py")
-
-            except BaseException as e:
-                execVal=0
-                print(str(e))
-                splash.draw_rectangle(btn_col[0], btn_row-26,btn_col[0]+220,26, color=splash_theme_color, thickness=1)
-                splash.draw_string(btn_col[0], btn_row-85, splash_text[9], color=(255,0,0), thickness = 1)
-                #screenShow()
-                display.show(splash)
-    elif(pageVal==1):
-        if(execVal==0):
-            screenSecondPage()
-            #print("show(demoSelect)")
-        else:
-            demo_i=int(demoSelect/6)
-            demo_j=demoSelect%6
-            demo_m=int(demoNum/6)
-            demo_n=demoNum%6
-            splash.draw_rectangle(0,33+30*demo_j,319,33+30*(demo_j+1),color=color_orange,thickness=-1)
-            splash.draw_rectangle(0,33+30*demo_j,319,33+30*(demo_j+1),color=color_white,thickness=1)
-            splash.draw_string(8, 39+30*demo_j,splash_text[11] , color=color_white, thickness = 1)
-            #screenShow()
-            display.show(splash)
-            time.sleep(0.5)
-            app_path_1='ln -sf /root/preset/app/'
-            app_path_2='.py /tmp/event && touch /tmp/start'
-            app_path=app_path_1+demoNameList[execVal-2]+app_path_2
-            #print(app_path)
-            try:
-                with open( '/tmp/page.txt', 'w' ) as f:
-                    f.write(str(pageVal))
-            except:
-                pass
-            try:
-                with open( '/tmp/menu.txt', 'w' ) as f:
-                    f.write(str(demoSelect))
-            except:
-                pass
-            pageSig=1
-            selectSig=1
-            os.system(app_path)
-    else:
-        if systemRunNum==0:
-            systemPage()
-            systemRunNum=systemRunNum+1
-        else:
-            pass
-
-def screenShow():
-    from maix import image,display,camera
-    global img_drop
-    screenCapture=splash.crop(0,0,240,320)
-    img_drop.draw_image((screenCapture.rotate(0,adjust=1)),0,0)
-    #img_drop.draw_image((screenCapture.rotate(-90,adjust=1)),0,0)
-    display.show(img_drop)
-try:
-    with open( '/tmp/filesyStem.txt', 'w' ) as f:
-        f.write("a")
-    #os.system("rm /etc/wifi/wpa_supplicant.conf && touch /etc/wifi/wpa_supplicant.conf && sync && fsck.ext4 -p /dev/root && mount -o remount -o rw /dev/root && rm /etc/wifi/wpa_supplicant.conf && touch /etc/wifi/wpa_supplicant.conf && sync &")
-    os.system("sync && rm /tmp/filesyStem.txt && sync")
-    #os.system("fsck.ext4 -p /dev/root && mount -o remount -o rw /dev/root")
-    #os.system("rm /etc/wifi/wpa_supplicant.conf && touch /etc/wifi/wpa_supplicant.conf && sync")
-    
-except:
-    os.system("fsck.ext4 -p /dev/root && mount -o remount -o rw /dev/root")
-
-try:
-    os.popen("cd /root/preset/server/ && python wirelessServer.py &")
-except:
-    pass
-while True:
-    buttonDectect()
-    running()
-
-del key_A
-del key_B
-del key_C
-del key_D
-
-
-
-
+#!/usr/bin/env python
+#version    :       2024.08.08
+#language   :       en
+#hardware   :       pi
+import time
+from maix import *
+import gc
+import os,sys
+import sys
+sys.path.append('/root/')
+from CocoPi import BUTTON
+from CocoPi import stm8s
+from CocoPi import multiFuncGpio
+from CocoPi import singleRgb
+from CocoPi import LED
+
+gc.enable()
+gc.collect()
+iic_slaver=stm8s()
+iic_slaver.clear()
+PIXEL_LED1= multiFuncGpio(0,7)
+PIXEL_LED2= multiFuncGpio(1,7)
+PIXEL_LED1.pixelInit_()
+time.sleep(0.1)
+PIXEL_LED2.pixelInit_()
+time.sleep(0.1)
+L1=singleRgb()
+L1.setColor(0,0,0)
+L1.show()
+time.sleep(0.1)
+L2=LED()
+L2.out(0)
+del iic_slaver
+del PIXEL_LED1
+del PIXEL_LED2
+del L1
+del L2
+
+count = 0
+
+def gc_log():
+    global count
+    gc.collect()
+    count = count + 1
+
+splash_theme_color = (15,21,46)
+btn_selected = (255,255,255)
+btn_unselected = (76,86,127)
+txt_selected = (255,255,255)
+txt_unselected = (76,86,127)
+color_splash_theme = (15,21,46)
+color_blue = (31,61,185)
+color_blue_lighter = (60,131,211)
+color_white = (255,255,255)
+color_gray = (60,73,126)
+color_orange = (255,165,0)
+color_red = (255,0,0)
+
+
+btn_width = 134
+btn_height = 52
+btn_y_base = 5
+btn_col = (btn_y_base, btn_y_base+btn_width, btn_y_base+152)
+btn_row = 180
+
+main_title = (
+        "Run",
+        "Latest code",
+        "Open",
+        "Demo list",
+        "B",
+        "A"
+    )
+splash_text = (
+        "Version: 2024-08-08 ",
+        "System version: N/A",
+        "2. After loading the code,press ",
+        "   KEY-A for 2s to back to start ",
+        "   interface.",
+        "Running Latest Code...",
+        "Error: code not found.",
+        "Error: invalid syntax",
+        "Opening Demo Menu...",
+        "Demo menu not found.",
+        "Run",
+        "Loading...",
+        "Back",
+        "Press KEY-C To Back",
+        "Press KEY-D To Reboot",
+        "Press KEY-B To Poweroff",
+        "1. Press KEY-A for 5s to shut down",
+        "   the CocoPi or reboot the CocoPi.",
+        "    ",
+        "CocoPi V6",
+        "/ Linux / AIot /Python /",
+        "/Graphical programming /",
+        "------- BASIC -------",
+        "-------- AI ---------",
+        "-------- IoT --------",
+    )
+
+title_logo_text = image.open("/root/preset/img/cocorobo_text.jpg")
+iconUpNp = image.open("/root/preset/img/arrow_up_filled.jpg")
+iconUpP = image.open("/root/preset/img/arrow_up_pressed.jpg")
+iconDownNp = image.open("/root/preset/img/arrow_down_filled.jpg")
+iconDownP = image.open("/root/preset/img/arrow_down_pressed.jpg")
+frostedGlass = image.open("/root/preset/img/frostedglass_.jpg")
+#backUp = image.open("/root/preset/img/backup_48x48.png")
+#powerOff = image.open("/root/preset/img/poweroff_48x48.png")
+#reBoot = image.open("/root/preset/img/reboot_48x48.png")
+
+run_user_code_path='/root/user_latest_code.py'
+
+
+key_A = BUTTON(14)
+key_B = BUTTON(8)
+key_C = BUTTON(13)
+key_D = BUTTON(7)
+
+splash = image.new(size=(320, 240),mode = "RGB")
+img_drop=image.new(size=(320,240),mode="RGB")
+
+demo_i=0
+demo_j=0
+demo_m=0
+demo_n=0
+pressTime=0
+systemRunNum=0
+
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
+def screenFirstPage():
+    from maix import display,image,camera
+    global splash,title_logo_text,btn_col,btn_row,splash_text,txt_unselected,txt_selected,btn_selected,btn_unselected,\
+splash_theme_color,btn_height,btn_width,main_title,menuSelect,gc_log,demo_i,demo_j,demo_m,demo_n,screenShow,img_drop,\
+frostedGlass
+    gc_log()
+    
+    splash.clear()
+    splash.draw_rectangle(0,0,320,320,color=splash_theme_color,thickness=-1)
+    splash.draw_image(title_logo_text, btn_col[0]+16, 10)
+    x, y = image.get_string_size(splash_text[0], 1)
+    
+    splash.draw_string(btn_col[0]+16, 40, splash_text[19]+"  "+splash_text[0], color=(0,255,255), thickness = 1)
+#    splash.draw_string(btn_col[0], 60, splash_text[20], color=(0,255,255), thickness = 1)
+#    splash.draw_string(btn_col[0], 80, splash_text[21], color=(0,255,255), thickness = 1)
+#    splash.draw_string(btn_col[0], 60, splash_text[0], color=(0,255,255), thickness = 1)
+    splash.draw_string(btn_col[0]+16, btn_row-105, splash_text[16], color=txt_unselected, thickness = 1)
+    splash.draw_string(btn_col[0]+16, btn_row-85, splash_text[17], color=txt_unselected, thickness = 1)
+    #splash.draw_string(btn_col[0], btn_row-105, splash_text[18], color=txt_unselected, thickness = 1)
+    splash.draw_string(btn_col[0]+16, btn_row-65, splash_text[2], color=txt_unselected, thickness = 1)
+    splash.draw_string(btn_col[0]+16, btn_row-45, splash_text[3], color=txt_unselected, thickness = 1)
+    splash.draw_string(btn_col[0]+16, btn_row-25, splash_text[4], color=txt_unselected, thickness = 1)
+
+    if menuSelect==0:
+        splash.draw_rectangle(btn_col[1]+40, btn_row, btn_col[1]+btn_width+42, btn_row+btn_height, color=btn_selected, thickness=1)
+        splash.draw_string(btn_col[1]+52, btn_row+7, main_title[2], color=txt_selected, thickness = 1)
+        splash.draw_string(btn_col[1]+52, btn_row+27, main_title[3], color=txt_selected, thickness = 1)
+        splash.draw_string(btn_col[1]+157, btn_row+27, main_title[5], color=txt_unselected, thickness = 1)
+
+        splash.draw_rectangle(btn_col[0], btn_row, btn_col[0]+btn_width, btn_row+btn_height, color=btn_selected, thickness=1)
+        splash.draw_string(btn_col[0]+96, btn_row+7, main_title[0], color=txt_selected, thickness = 1)
+        splash.draw_string(btn_col[0]+26, btn_row+27, main_title[1], color=txt_selected, thickness = 1)
+        splash.draw_string(btn_col[0]+7, btn_row+27, main_title[4], color=txt_unselected, thickness = 1)
+
+    if menuSelect==1:
+        splash.draw_rectangle(btn_col[0], btn_row, btn_col[0]+btn_width, btn_row+btn_height, color=btn_unselected, thickness=1)
+        splash.draw_string(btn_col[0]+7, btn_row+7, main_title[0], color=txt_unselected, thickness = 1)
+        splash.draw_string(btn_col[0]+7, btn_row+27, main_title[1], color=txt_unselected, thickness = 1)
+
+        splash.draw_rectangle(btn_col[1], btn_row, btn_col[1]+btn_width, btn_row+btn_height, color=btn_selected, thickness=1)
+        splash.draw_string(btn_col[1]+7, btn_row+7, main_title[2], color=txt_selected, thickness = 1)
+        splash.draw_string(btn_col[1]+7, btn_row+27, main_title[3], color=txt_selected, thickness = 1)
+
+    splash.draw_image(frostedGlass, 0, 0,alpha=0.2)
+    #screenShow()
+    display.show(splash)
+
+def screenSecondPage():
+    from maix import display, image,camera
+    global splash,title_logo_text,btn_col,btn_row,splash_text,txt_unselected,txt_selected,btn_selected,btn_unselected,\
+splash_theme_color,btn_height,btn_width,main_title,demoSelect,gc_log,color_splash_theme,color_blue,color_blue_lighter,\
+color_white,color_gray,color_orange,color_red,iconUpNp,iconUpP,iconDownNp,iconDownP,demoListText,screenShow,img_drop,\
+frostedGlass
+    gc_log()
+    splash.clear()
+    splash.draw_rectangle(0,0,320,240,color=splash_theme_color,thickness=-1)
+    splash.draw_rectangle(0,0,320,32,color=color_blue,thickness=-1)
+    splash.draw_image(iconUpNp, 3, 3)
+    splash.draw_image(iconDownNp, 287, 3)
+    
+    splash.draw_rectangle(0,214,50,240,color=color_blue,thickness=-1)
+    splash.draw_rectangle(270,214,320,240,color=color_blue,thickness=-1)
+    splash.draw_string(12, 218, splash_text[10], color=(255,255,255), thickness = 1)
+    splash.draw_string(282, 218, splash_text[12], color=(255,255,255), thickness = 1)
+    
+    demo_i=int(demoSelect/6)
+    demo_j=demoSelect%6
+    demo_m=int(demoNum/6)
+    demo_n=demoNum%6
+    for j in range(6):
+        if demo_i==demo_m:
+            if j>=demo_n:
+                pass
+            else:
+                if j==demo_j:
+                    pass
+                else:
+                    splash.draw_rectangle(0,33+30*j,319,33+30*(j+1),color=color_gray,thickness=1)
+                    splash.draw_string(8, 39+30*j,demoListText[j+demo_i*6] , color=color_gray, thickness = 1)
+        else:
+            if j==demo_j:
+                pass
+            else:
+                splash.draw_rectangle(0,33+30*j,319,33+30*(j+1),color=color_gray,thickness=1)
+                splash.draw_string(8, 39+30*j,demoListText[j+demo_i*6] , color=color_gray, thickness = 1)
+    if demoSelect<13:
+        splash.draw_string(72, 10, splash_text[22], color=(255,255,255), thickness = 1)
+    elif demoSelect<31:
+        splash.draw_string(72, 10, splash_text[23], color=(255,255,255), thickness = 1)
+    else:
+        splash.draw_string(72, 10, splash_text[24], color=(255,255,255), thickness = 1)
+    splash.draw_rectangle(0,33+30*demo_j,319,33+30*(demo_j+1),color=color_white,thickness=1)
+    splash.draw_string(8, 39+30*demo_j,demoListText[demoSelect] , color=color_white, thickness = 1)
+    splash.draw_string(146, 218, str(demoSelect+1), color=(255,255,255), thickness = 1)
+    splash.draw_string(160, 218, "/"+str(demoNum), color=(255,255,255), thickness = 1)
+    splash.draw_image(frostedGlass, 0, 0,alpha=0.2)
+    #screenShow()
+    display.show(splash)
+
+def systemPage():
+    from maix import display, image,camera
+    import time
+    global splash,title_logo_text,btn_col,btn_row,splash_text,txt_unselected,txt_selected,btn_selected,btn_unselected,\
+splash_theme_color,btn_height,btn_width,main_title,demoSelect,gc_log,color_splash_theme,color_blue,color_blue_lighter,\
+color_white,color_gray,color_orange,color_red,iconUpNp,iconUpP,iconDownNp,iconDownP,demoListText,screenShow,img_drop,\
+frostedGlass
+    for i in range(10):
+        splash.draw_image(frostedGlass, 0, 0,alpha=0.2)
+        #screenShow()
+        display.show(splash)
+    splash.draw_string(80, 68, splash_text[13], 1,color=(0,255,0), thickness = 1)
+    splash.draw_string(80, 118, splash_text[14], 1,color=(255,255,0), thickness = 1)
+    splash.draw_string(80, 168, splash_text[15], 1,color=(255,0,0), thickness = 1)
+    #splash.draw_image(backUp, 20, 140)
+    #screenShow()
+    splash.draw_image((image.open("/root/preset/img/backup_00ff00_32x32.png")).rotate(0, adjust=0),40,60,alpha=1)
+    splash.draw_image((image.open("/root/preset/img/reboot_ffff00_32x32.png")).rotate(0, adjust=0),40,110,alpha=1)
+    splash.draw_image((image.open("/root/preset/img/poweroff_ff0000_32x32.png")).rotate(0, adjust=0),40,160,alpha=1)
+    
+    display.show(splash)
+
+pageVal=0
+menuSelect=0
+demoSelect=0
+execVal=0
+demoListText=(
+    "Camera",
+    "Photo Viewer",
+    "Color Detection",
+    "Audio Recorder",
+    "Audio Player",
+    "Play Music",
+    "Play Video",
+    "Time Counter",
+    "Local Time Clock",
+    "Servo Control",
+    "Motor Control",
+    "Picture Loop Play",
+    "QR Code Scanner",
+    "Human Detection",
+    "Face Recognition",
+    "Face Comparison",
+    "Object Recognition",
+    "Edge Detection",
+    "Handwritten Digit Recognition",
+    "Car License Plate Recognition",
+    "Mask Detection",
+    "Gesture Recognition",
+    "Finger Guessing",
+    "Wi-Fi QR Code Scanner",
+    "About CocoPi",
+    "Internet Camera",
+    "Internet Weather Prediction",
+    "Internet Time Clock",
+    "Environment Detection",
+    "Model Training:Data Collect",
+    "Model Training:Deploy Model",
+    "Mnist Model Training",
+    "Mnist Camera Test",
+    "CocoGPT",
+    "CocoTerminal",
+    "Picture Analysis",
+    "Speech To Image",
+    "Jumpbot",
+    "Gluttonous Snake",
+    "Sound Loudness Analysis",
+    "Sound Spectrum Analysis",
+    "checkout",
+    "pull",
+    "reset",
+
+)
+demoNameList=(
+    "01_camera",
+    "02_photoViewer",
+    "03_colorDetection",
+    "04_recorder",
+    "05_audioPlayer",
+    "06_musicPlayer",
+    "07_videoPlayer",
+    "08_timeCounter",
+    "09_localTimeClock",
+    "10_servoControl",
+    "11_motorControl",
+    "12_pictureLoopPlay",
+    "13_qrCodeScanner",
+    "14_humanDetection",
+    "15_faceDetection",
+    "16_faceComparison",
+    "17_objectRecognition",
+    "18_edgeDetection",
+    "19_handWrittenDigiRecognition",
+    "20_carLicensePlateRecognition",
+    "21_maskDetection",
+    "22_gestureRecognition",
+    "23_fingerGuessing",
+    "24_connectWiFi",
+    "25_aboutCocoPi",
+    "26_internetCamera",
+    "27_internetWeatherPrediction",
+    "28_internetTimeClock",
+    "29_environmentDetection",
+    "30_training_data_collect",
+    "31_training_deploy_model",
+    "32_mnistModelTraining",
+    "33_mnistCameraTest",
+    "34_CocoGPT",
+    "35_CocoTerminal",
+    "36_pictureAnalysis",
+    "37_speechToImageSynthesis",
+    "38_jumpbot",
+    "39_gluttonousSnake",
+    "40_soundLoudnessAnalysis",
+    "41_soundSpectrumAnalysis",
+    "checkout",
+    "pull",
+    "reset",
+)
+demoNum=len(demoListText)
+pageSig=1
+selectSig=1
+
+###需要查询的文件夹目录及文件格式后缀###
+def getAimFileList(filePath="/root/",selectFile=".REC"):
+    import os
+    FileList=[]
+    aimFilePath=filePath
+    aimFile=selectFile
+    aimFileLenth=len(selectFile)*(-1)
+    for root,dirs,files in os.walk(aimFilePath):
+        for name in files:
+            if str(name)[aimFileLenth:]==aimFile:
+                FileList.append(name)
+    return FileList
+
+def buttonDectect():
+    from maix import display, image,camera
+    import time
+    import os
+    global key_A,key_B,key_C,key_D,pageVal,menuSelect,execVal,demoNum,demoSelect,splash,iconUpP,iconDownP,screenShow,img_drop,systemRunNum,pageSig,selectSig
+
+    if(pageVal==0):
+        if(key_A.is_pressed()):
+            pressTime=time.perf_counter()
+            while key_A.is_pressed()==1:
+                if(time.perf_counter()-pressTime)<5:
+                    time.sleep(0.001)
+                    pageVal=1
+                else:
+                    pageVal=2
+                    break
+            execVal=0
+        elif(key_B.is_pressed()):
+            while key_B.is_pressed()==1:
+                time.sleep(0.001)
+            execVal=1
+#         elif (key_B.is_pressed()):
+#             while key_B.is_pressed()==1:
+#                 time.sleep(0.001)
+#             pageVal=1
+        else:
+            pass
+    elif(pageVal==1):
+        if execVal==0:
+            if(key_D.is_pressed()):
+                splash.draw_image(iconUpP, 3, 3)
+                #screenShow()
+                display.show(splash)
+                while key_D.is_pressed()==1:
+                    time.sleep(0.001)
+                demoSelect=demoSelect-1
+                if(demoSelect==-1):
+                    demoSelect=demoNum-1
+            elif (key_C.is_pressed()):
+                splash.draw_image(iconDownP, 287, 3)
+                #screenShow()
+                display.show(splash)
+                while key_C.is_pressed()==1:
+                    time.sleep(0.001)
+                demoSelect=demoSelect+1
+                if(demoSelect==demoNum):
+                    demoSelect=0
+            elif (key_B.is_pressed()):
+                while key_B.is_pressed()==1:
+                    time.sleep(0.001)
+                execVal=2+demoSelect
+            elif (key_A.is_pressed()):
+                while key_A.is_pressed()==1:
+                    time.sleep(0.001)
+                menuSelect=0
+                pageVal=0
+                demoSelect=0
+                execVal=0
+                try:
+                    with open( '/tmp/page.txt', 'w' ) as f:
+                        f.write(str(pageVal))
+                except:
+                    pass
+                try:
+                    with open( '/tmp/menu.txt', 'w' ) as f:
+                        f.write(str(demoSelect))
+                except:
+                    pass
+                pageSig=1
+                selectSig=1
+            else:
+                pass
+        else:
+            if (key_A.is_pressed()):
+                while key_A.is_pressed()==1:
+                    time.sleep(0.001)
+                menuSelect=0
+                pageVal=0
+                demoSelect=0
+                execVal=0
+                systemRunNum=0
+    elif pageVal==2:
+        if(key_C.is_pressed()):
+            pageVal=0
+            menuSelect=0
+            pageVal=0
+            demoSelect=0
+            execVal=0
+            systemRunNum=0
+        elif key_B.is_pressed():
+            os.system("poweroff")
+        elif key_D.is_pressed():
+            os.system("reboot")
+    else:
+        pass
+
+def running():
+    from maix import display, image,camera
+    global splash,title_logo_text,btn_col,btn_row,splash_text,txt_unselected,txt_selected,btn_selected,btn_unselected,\
+splash_theme_color,btn_height,btn_width,main_title,menuSelect,pageVal,execVal,screenFirstPage,screenSecondPage,\
+color_splash_theme,color_blue,color_blue_lighter,color_white,color_gray,color_orange,color_red,demo_i,demo_j,\
+demo_m,demo_n,screenShow,img_drop,systemRunNum,systemPage,demoNameList,pageSig,selectSig,demoSelect
+    if pageSig==1:
+        try:
+            with open( '/tmp/page.txt', 'r' ) as f:
+                pageVal=int(f.read())
+                print(pageVal)
+            pageSig=0
+        except:
+            pass
+    if selectSig==1:
+        try:
+            with open( '/tmp/menu.txt', 'r' ) as f:
+                demoSelect=int(f.read())
+                print(demoSelect)
+            selectSig=0
+        except:
+            pass
+    
+    if(pageVal==0):
+        screenFirstPage()
+        if(execVal==0):
+            pass
+            #splash.draw_rectangle(btn_col[0], btn_row-26,btn_col[0]+220,26, color=splash_theme_color, thickness=1)
+            #screenShow()
+            #display.show(splash)
+        else:
+            try:
+                splash.draw_string(btn_col[0], btn_row-25, splash_text[5], color=(0,255,255),thickness = 1)
+                #screenShow()
+                display.show(splash)
+                time.sleep(0.5)
+                os.system("ln -sf %s /tmp/event && touch /tmp/start" % "/root/user_latest_code.py")
+
+            except BaseException as e:
+                execVal=0
+                print(str(e))
+                splash.draw_rectangle(btn_col[0], btn_row-26,btn_col[0]+220,26, color=splash_theme_color, thickness=1)
+                splash.draw_string(btn_col[0], btn_row-85, splash_text[9], color=(255,0,0), thickness = 1)
+                #screenShow()
+                display.show(splash)
+    elif(pageVal==1):
+        if(execVal==0):
+            screenSecondPage()
+            #print("show(demoSelect)")
+        else:
+            demo_i=int(demoSelect/6)
+            demo_j=demoSelect%6
+            demo_m=int(demoNum/6)
+            demo_n=demoNum%6
+            splash.draw_rectangle(0,33+30*demo_j,319,33+30*(demo_j+1),color=color_orange,thickness=-1)
+            splash.draw_rectangle(0,33+30*demo_j,319,33+30*(demo_j+1),color=color_white,thickness=1)
+            splash.draw_string(8, 39+30*demo_j,splash_text[11] , color=color_white, thickness = 1)
+            #screenShow()
+            display.show(splash)
+            time.sleep(0.5)
+            app_path_1='ln -sf /root/preset/app/'
+            app_path_2='.py /tmp/event && touch /tmp/start'
+            app_path=app_path_1+demoNameList[execVal-2]+app_path_2
+            #print(app_path)
+            try:
+                with open( '/tmp/page.txt', 'w' ) as f:
+                    f.write(str(pageVal))
+            except:
+                pass
+            try:
+                with open( '/tmp/menu.txt', 'w' ) as f:
+                    f.write(str(demoSelect))
+            except:
+                pass
+            pageSig=1
+            selectSig=1
+            os.system(app_path)
+    else:
+        if systemRunNum==0:
+            systemPage()
+            systemRunNum=systemRunNum+1
+        else:
+            pass
+
+def screenShow():
+    from maix import image,display,camera
+    global img_drop
+    screenCapture=splash.crop(0,0,240,320)
+    img_drop.draw_image((screenCapture.rotate(0,adjust=1)),0,0)
+    #img_drop.draw_image((screenCapture.rotate(-90,adjust=1)),0,0)
+    display.show(img_drop)
+try:
+    aimFileShow=getAimFileList()
+    aimFileNum=len(aimFileShow)
+    
+    if aimFileNum>0:
+        #os.system("rm /root/"+aimFileShow[0])
+        os.system("rm /root/*.REC")
+        #print("del rec action!")
+        #aimFileShow=getAimFileList()
+        #aimFileNum=len(aimFileShow)
+        #print(aimFileShow)
+except:
+    pass
+
+try:
+    os.system("touch /etc/wifi/test")
+except:
+    os.system("{ wpa_supplicant -i wlan0 -D nl80211 -c /etc/wifi/wpa_supplicant.conf -O /etc/wifi/sockets -B ; } ; \
+    { [ -f /etc/wifi/wpa_supplicant.conf.tmp ] && rm /etc/wifi/wpa_supplicant.conf.tmp && rm /etc/wifi/wpa_supplicant.conf && echo "" \
+    > /etc/wifi/wpa_supplicant.conf; sync; } ; { echo "" > /etc/wifi/fileCfgTest && echo "" > /root/fileCfgTest && echo "" > \
+    /home/fileCfgTest && echo "" > /tmp/fileCfgTest; } || { sync; fsck.ext4 -y /dev/root; fsck.ext4 -y /dev/mmcblk0p4; \
+    (mount -o remount,rw -n /dev/root / ; mount -o remount,rw -n /dev/mmcblk0p4 / ; mount -o remount,rw -n /dev/mmcblk0p4 /mnt/UDISK ;\
+    mount -o remount,rw -n / / ; mount -o remount,rw -n /root / ; ) ; fsck.ext4 -y /dev/root; fsck.ext4 -y /dev/mmcblk0p4; sync ; }")
+finally:
+    os.system("rm /etc/wifi/test")
+
+try:
+    os.popen("cd /root/preset/server/ && python wirelessServer.py &")
+except:
+    pass
+while True:
+    buttonDectect()
+    running()
+
+del key_A
+del key_B
+del key_C
+del key_D
+

+ 2 - 2
preset/app/01_camera.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #version    :       2024.03.14
-#language   :       ch
+#language   :       en
 #camera     :       CR5205
 
 from maix import camera
@@ -11,7 +11,7 @@ import sys
 sys.path.append('/root/')
 from CocoPi import BUTTON
 
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 buttonState=0
 newState=0
 oldState=0

+ 4 - 4
preset/app/02_photoViewer.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #version    :       2024.03.15
-#language   :       ch
+#language   :       en
 #camera     :       CR5205
 
 import os
@@ -18,7 +18,7 @@ key_B = BUTTON(8)
 key_C = BUTTON(13)
 key_D = BUTTON(7)
 camera.camera.config(size=(320,240))
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 
 ###需要查询的文件夹目录及文件格式后缀###
 def getImgFileList(filePath="/root/user/img/",selectFile=".jpg"):
@@ -43,7 +43,7 @@ blackBlock=image.new(size=(320, 24), mode="RGB", color=(0, 0, 0))
 while True:
     if picNum==0:
         canvas.clear()
-        canvas.draw_string(24, 100, "未找到 .jpg 格式图片!", 1, color=(255, 0, 0))
+        canvas.draw_string(24, 100, "Not found any jpg format picture!", 1, color=(255, 0, 0))
     else:
         if key_B.is_pressed():
             while key_B.is_pressed():
@@ -74,7 +74,7 @@ while True:
             try:
                 canvas.draw_image((image.open("/root/user/img/"+pngImgShow[picSelect])),0,0)
             except:
-                canvas.draw_string(64, 100, "无法打开此张图片!", 1, color=(255,0, 0))
+                canvas.draw_string(64, 100, "Can't open this picture!", 1, color=(255,0, 0))
             canvas.draw_string(60, 218, pngImgShow[picSelect], color=(255,255,255), thickness = 1)
             
     

+ 2 - 2
preset/app/03_colorDetection.py

@@ -1,11 +1,11 @@
 #!/usr/bin/env python
 #version    :       2023.12.31
-#language   :       ch
+#language   :       en
 from maix import display
 from maix import image
 from maix import camera
 camera.camera.config(size=(320,240))
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 
 while True:
     canvas = camera.capture()

+ 13 - 13
preset/app/04_recorder.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 from maix import display
 from maix import image
 from maix import camera
@@ -44,7 +44,7 @@ RATE = 44100
 #屏幕初始化
 canvas = image.new(size=(320, 240),color = (15,21,46),mode = "RGB")
 
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 startPointer=0
 startTime=0
 global deltaTime
@@ -56,8 +56,8 @@ newState=0
 savePathHead="/root/user/audio/"
 savePathTail=".wav"
 recordState=0
-canvas.draw_string(12, 18, "提示:按下C键来开始/停止录音!", 1, color=(0, 255, 0))
-canvas.draw_string(58, 48, "   ", 1, color=(0, 255, 0))
+canvas.draw_string(12, 18, "Tip : Press KEY-C to start/stop", 1, color=(0, 255, 0))
+canvas.draw_string(58, 48, "recording!", 1, color=(0, 255, 0))
 canvas.draw_image(image.open("/root/preset/img/recording.png"),288 , 8,alpha=1)
 canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
 display.show(canvas)
@@ -71,10 +71,10 @@ while True:
         if startPointer==0:
             canvas.clear()
             canvas = image.new(size=(320, 240),color = (15,21,46),mode = "RGB")
-            canvas.draw_string(12, 18, "提示:按下C键来开始/停止录音!", 1, color=(0, 255, 0))
-            canvas.draw_string(58, 48, "   ", 1, color=(0, 255, 0))
+            canvas.draw_string(12, 18, "Tip : Press KEY-C to start/stop", 1, color=(0, 255, 0))
+            canvas.draw_string(58, 48, "recording!", 1, color=(0, 255, 0))
             canvas.draw_image(image.open("/root/preset/img/recording.png"),288 , 8,alpha=1)
-            canvas.draw_string(24, 108, "开始录音!", 1, color=(0, 255, 0))
+            canvas.draw_string(24, 108, "Recording start!", 1, color=(0, 255, 0))
             canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
             display.show(canvas)
             print("Recording start!")
@@ -105,12 +105,12 @@ while True:
             deltaTime = round(time.time() - startTime, 2)
             canvas.clear()
             canvas = image.new(size=(320, 240),color = (15,21,46),mode = "RGB")
-            canvas.draw_string(12, 18, "提示:按下C键来开始/停止录音!", 1, color=(0, 255, 0))
-            canvas.draw_string(58, 48, "   ", 1, color=(0, 255, 0))
+            canvas.draw_string(12, 18, "Tip : Press KEY-C to start/stop", 1, color=(0, 255, 0))
+            canvas.draw_string(58, 48, "recording!", 1, color=(0, 255, 0))
             canvas.draw_image(image.open("/root/preset/img/recording.png"),288 , 8,alpha=1)
-            canvas.draw_string(24, 108, "录制完成!", 1, color=(0, 255, 0))
-            canvas.draw_string(24, 128, "持续时间(秒):"+str(deltaTime), 1, color=(0, 255, 0))
-            canvas.draw_string(24, 148, "文件保存路径:", 1, color=(0, 255, 0))
+            canvas.draw_string(24, 108, "Recording completed!", 1, color=(0, 255, 0))
+            canvas.draw_string(24, 128, "Lasttime:"+str(deltaTime), 1, color=(0, 255, 0))
+            canvas.draw_string(24, 148, "File Save Path:", 1, color=(0, 255, 0))
             canvas.draw_string(24, 168, WAVE_OUTPUT_FILENAME, 1, color=(0, 255, 0))
             canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
             

+ 10 - 10
preset/app/05_audioPlayer.py

@@ -1,6 +1,6 @@
 #!/usr/bin/python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 import os
 from maix import display
 from maix import image
@@ -11,12 +11,12 @@ import wave
 import sys
 sys.path.append('/root/')
 from CocoPi import BUTTON
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 key_A = BUTTON(14)
 key_B = BUTTON(8)
 key_C = BUTTON(13)
 key_D = BUTTON(7)
-camera.camera.config(size=(240,320))
+camera.camera.config(size=(320,240))
 
 buttonState=0
 newState=0
@@ -63,7 +63,7 @@ while True:
         canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
         canvas.draw_image((image.open("/root/preset/img/left_ffffff_16x16.png")).rotate(0, adjust=0),6,4,alpha=1)
         canvas.draw_image((image.open("/root/preset/img/left_ffffff_16x16.png")).rotate(180, adjust=0),296,4,alpha=1)
-        canvas.draw_string(4, 140, "未找到WAV格式音频文件!", 1, color=(0, 255, 0))
+        canvas.draw_string(4, 140, "Not found any wav format audio!", 1, color=(0, 255, 0))
         display.show(canvas)
     else:
         if key_C.is_pressed():
@@ -93,7 +93,7 @@ while True:
                 canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
                 canvas.draw_image((image.open("/root/preset/img/left_ffffff_16x16.png")).rotate(0, adjust=0),6,4,alpha=1)
                 canvas.draw_image((image.open("/root/preset/img/left_ffffff_16x16.png")).rotate(180, adjust=0),296,4,alpha=1)
-                canvas.draw_string(4, 80, "音频状态:正在播放!", 1, color=(0, 255, 0))
+                canvas.draw_string(4, 80, "Audio State:Playing!", 1, color=(0, 255, 0))
                 canvas.draw_image((image.open("/root/preset/img/stop24.png")).rotate(0, adjust=0),4,216,alpha=1)
                 canvas.draw_string(104, 218, wavShow[audioSelect], 1, color=(0, 255, 0))
                 display.show(canvas)
@@ -117,7 +117,7 @@ while True:
                     canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
                     canvas.draw_image((image.open("/root/preset/img/left_ffffff_16x16.png")).rotate(0, adjust=0),6,4,alpha=1)
                     canvas.draw_image((image.open("/root/preset/img/left_ffffff_16x16.png")).rotate(180, adjust=0),296,4,alpha=1)
-                    canvas.draw_string(4, 80, "音频状态:播放完成!", 1, color=(0, 255, 0))
+                    canvas.draw_string(4, 80, "Audio State:Play completed!", 1, color=(0, 255, 0))
                     canvas.draw_image((image.open("/root/preset/img/play24.png")).rotate(0, adjust=0),4,216,alpha=1)
                     canvas.draw_string(104, 218, wavShow[audioSelect], 1, color=(0, 255, 0))
                     display.show(canvas)
@@ -134,7 +134,7 @@ while True:
                 canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
                 canvas.draw_image((image.open("/root/preset/img/left_ffffff_16x16.png")).rotate(0, adjust=0),6,4,alpha=1)
                 canvas.draw_image((image.open("/root/preset/img/left_ffffff_16x16.png")).rotate(180, adjust=0),296,4,alpha=1)
-                canvas.draw_string(4, 80, "音频状态:等待播放!", 1, color=(0, 255, 0))
+                canvas.draw_string(4, 80, "Audio State:Waiting for playback!", 1, color=(0, 255, 0))
                 canvas.draw_image((image.open("/root/preset/img/play24.png")).rotate(0, adjust=0),4,216,alpha=1)
                 canvas.draw_string(104, 218, wavShow[audioSelect], 1, color=(0, 255, 0))
                 display.show(canvas)
@@ -149,9 +149,9 @@ while True:
                 canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
                 canvas.draw_image((image.open("/root/preset/img/left_ffffff_16x16.png")).rotate(0, adjust=0),6,4,alpha=1)
                 canvas.draw_image((image.open("/root/preset/img/left_ffffff_16x16.png")).rotate(180, adjust=0),296,4,alpha=1)
-                canvas.draw_string(4, 80, "音频状态:播放结束!", 1, color=(0, 255, 0))
+                canvas.draw_string(4, 80, "Audio State:Play ended!", 1, color=(0, 255, 0))
                 canvas.draw_image((image.open("/root/preset/img/play24.png")).rotate(0, adjust=0),4,216,alpha=1)
-                canvas.draw_string(4, 100, "音频路径:"+wavShow[audioSelect], 1, color=(0, 255, 0))
+                canvas.draw_string(4, 100, "path:"+wavShow[audioSelect], 1, color=(0, 255, 0))
                 display.show(canvas)
                 playRunState=0
             else:

+ 1 - 1
preset/app/07_videoPlayer.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #version    :       2023.04.04
-#language   :       ch
+#language   :       en
 import pyaudio, av, os,_thread
 from maix import display, camera, image
 # ffmpeg -r 30 -i badapple_240_60fps.mp4 -vf scale=240:240,setdar=1:1 output.mp4

+ 9 - 9
preset/app/08_timeCounter.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 from maix import display
 from maix import image
 from maix import camera
@@ -11,8 +11,8 @@ from CocoPi import BUTTON
 # 秒表小程序
 key_C = BUTTON(13)
 key_B = BUTTON(8)
-camera.camera.config(size=(240,320))
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+camera.camera.config(size=(320,240))
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 signal=0
 startPointer=0
 startTime=0
@@ -50,20 +50,20 @@ while True:
             deltaTime = round(time.time() - startTime, 3)
             #deltaTime = time.time()-startTime
             #deltaTime = round(time.time()-startTime, 5)
-            #canvas.draw_string(80, 128, "持续时间:"+str(deltaTime), 1, color=(0, 255, 0))
+            #canvas.draw_string(80, 128, "lastTime:"+str(deltaTime), 1, color=(0, 255, 0))
         
     elif signal==0:
         startPointer=0
     else:
         pass
     if signal==1:
-        canvas.draw_string(80, 108, "正在计时中...", 1, color=(0, 255, 0))
+        canvas.draw_string(80, 108, "Counter is working...", 1, color=(0, 255, 0))
         canvas.draw_image((image.open("/root/preset/img/stop24.png")).rotate(0, adjust=0),288,2,alpha=1)
     else:
-        canvas.draw_string(80, 108, "等待计时...", 1, color=(0, 255, 0))
+        canvas.draw_string(80, 108, "Counter is waitting...", 1, color=(0, 255, 0))
         canvas.draw_image((image.open("/root/preset/img/play24.png")).rotate(0, adjust=0),288,2,alpha=1)
-    canvas.draw_string(80, 128, "计时持续时间(秒):"+str(deltaTime), 1, color=(0, 255, 0))
-    canvas.draw_string(16, 8, "按下C键来开始/停止计时!", 1, color=(0, 255, 0))
+    canvas.draw_string(100, 128, "Lasttime:"+str(deltaTime), 1, color=(0, 255, 0))
+    canvas.draw_string(16, 8, "Press KEY-C to start/stop Counter", 1, color=(0, 255, 0))
     
     canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),2,216,alpha=1)
     canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)

+ 3 - 3
preset/app/09_localTimeClock.py

@@ -1,9 +1,9 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 import time
 from maix import camera, display, image
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 while True:
     hello_img = image.new(size = (240, 240), color = (0, 0, 0), mode = "RGB")
     hello_img.draw_string(20, 108, time.asctime(), scale = 1.0, color = (255, 255, 255), thickness = 1)

+ 4 - 4
preset/app/10_servoControl.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.06.0`
+#language   :       en
 #hardware   :       pi
 
 from maix import display
@@ -21,7 +21,7 @@ camera.camera.config(size=(320,240))
 ScreenOrientation = False
 angle=0
 addValue=0
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 
 canvas = image.new(size = (320, 240))
 while True:
@@ -42,7 +42,7 @@ while True:
     angle=angle+addValue
     #canvas.draw_string(4, 180, "C:increase servo's angle", 1, color=(0, 255, 0))
     #canvas.draw_string(4, 200, "D:decrease servo's angle", 1, color=(0, 255, 0))
-    canvas.draw_string(80, 10, "舵机角度值:"+str(angle), 1, color=(0, 0, 255))
+    canvas.draw_string(80, 10, "servo angle:"+str(angle), 1, color=(0, 0, 255))
     canvas.draw_image((image.open("/root/preset/img/sg90.png")).rotate(0, adjust=1),132,70,alpha=1)
     canvas.draw_image((image.open("/root/preset/img/sg90_double_arm.png")).rotate(angle, adjust=0),103,89,alpha=1)
     canvas.draw_image((image.open("/root/preset/img/increase_bfbfbf_24x24.png")).rotate(0, adjust=0),288,8,alpha=1)

+ 4 - 5
preset/app/11_motorControl.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.08.18
+#language   :       en
 #hardware   :       pi
 from maix import display
 from maix import image
@@ -23,7 +23,7 @@ key_C = BUTTON(13)
 D1=dcMotor(1)
 D2=dcMotor(2)
 
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 camera.camera.config(size=(320,240))
 ScreenOrientation = False
 speed=0
@@ -52,7 +52,7 @@ while True:
     canvas = image.new(color=(0,0,0),size = (320, 240))
     
     speed=speed+addValue
-    canvas.draw_string(80, 8, "转速:"+str(speed), 1, color=(0, 255, 0))
+    canvas.draw_string(80, 8, "speed:"+str(speed), 1, color=(0, 255, 0))
     if rotation==1:
         canvas.draw_image((image.open("/root/preset/img/clockwise_bfbfbf_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
         #canvas.draw_string(40, 24, "rotation:clockwise", 1, color=(0, 255, 0))
@@ -84,7 +84,6 @@ while True:
         else:
             D1.dcMotorCtrl(0,speed)
             D2.dcMotorCtrl(0,speed)
-        time.sleep(0.004)
     if ScreenOrientation:
         canvasVER = canvas.crop(0,0,240,320)
         canvasVER = canvasVER.rotate(-90, adjust=1)

+ 2 - 2
preset/app/12_pictureLoopPlay.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 from maix import display
 
 from maix import image

+ 2 - 2
preset/app/13_qrCodeScanner.py

@@ -1,10 +1,10 @@
 #!/usr/bin/env python
 #version    :       2023.12.31
-#language   :       ch
+#language   :       en
 from maix import camera, display, zbar, image
 import sys
 sys.path.append('/root/CocoPi.py')
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 camera.camera.config(size=(320,240))
 
 while True:

+ 1 - 1
preset/app/14_humanDetection.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #version    :       2023.12.31
-#language   :       ch
+#language   :       en
 from time import time
 from maix import image
 class Person:

+ 3 - 3
preset/app/15_faceDetection.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 from maix import camera
 from maix import display
 
@@ -11,7 +11,7 @@ from maix.nn import decoder
 
 camera.camera.config(size=(320,240))
 
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 
 model = {
     "param": "/root/preset/model/yolo2_face_awnn.param",

+ 1 - 1
preset/app/16_faceComparison.py

@@ -1,5 +1,5 @@
 '''
-    Face recognize demo, download model from maixhub first:
+    Face recognize demo, download modle from maixhub first:
             https://maixhub.com/
 '''
 

+ 6 - 6
preset/app/17_objectRecognition.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 from maix import camera
 from maix import display
 
@@ -12,7 +12,7 @@ from maix.nn import decoder
 camera.camera.config(size=(320,240))
 
 ScreenOrientation = False
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 
 model = {
     "param": "/root/preset/model/yolo2_20class_awnn.param",
@@ -29,8 +29,8 @@ options = {
     "mean": [127.5, 127.5, 127.5],
     "norm": [0.0078125, 0.0078125, 0.0078125],
 }
-labels = ['飞机', '自行车', '鸟', '船', '瓶子', '公共汽车', '汽车', '猫', '椅子', '牛', '餐桌', '狗', '马', '摩托车', '人', '盆栽', '羊', '沙发', '火车', '电视监视器']
-#labels = ['plane', 'bicycle', 'bird', 'ship', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'table', 'dog', 'horse', 'motobike', 'human', 'Pot plant', 'sheep', 'sofa', 'train', 'tv']
+#labels = ['飞机', '自行车', '鸟', '船', '瓶子', '公共汽车', '汽车', '猫', '椅子', '牛', '餐桌', '狗', '马', '摩托车', '人', '盆栽', '羊', '沙发', '火车', '电视监视器']
+labels = ['plane', 'bicycle', 'bird', 'ship', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'table', 'dog', 'horse', 'motobike', 'human', 'Pot plant', 'sheep', 'sofa', 'train', 'tv']
 anchors = [5.4, 5.38, 1.65, 2.09, 0.8, 1.83, 2.45, 4.14, 0.46, 0.8]
 m = nn.load(model, opt=options)
 yolo2_decoder = decoder.Yolo2(len(labels), anchors, net_in_size=(options["inputs"]["input0"][0], options["inputs"]["input0"][1]), net_out_size=(7, 7))
@@ -66,7 +66,7 @@ while True:
             img_objectrecognition.draw_string(10,0, (str(str(labels[i[4][0]])) + str(round(i[4][1][i[4][0]]*100, 2))), scale = 1, color = (255,0,0) , thickness = 1)
             img_objectrecognition.draw_rectangle(i[0],i[1], int(i[0]+i[2]),int(i[1]+i[3]), color=(255,0,0), thickness=1)
     else:
-        img_objectrecognition.draw_string(10,0, "未识别到任何目标!", scale = 1, color = (255,0,0) , thickness = 1)
+        img_objectrecognition.draw_string(10,0, "Not recognize any object", scale = 1, color = (255,0,0) , thickness = 1)
     if ScreenOrientation:
         img_objectrecognitionVER = img_objectrecognition.crop(0,0,240,320)
         img_objectrecognitionVER = img_objectrecognitionVER.rotate(-90, adjust=1)

+ 3 - 3
preset/app/18_edgeDetection.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 from maix import camera
 from maix import display
 
@@ -11,7 +11,7 @@ import numpy as np
 camera.camera.config(size=(320,240))
 
 ScreenOrientation = False
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 
 class Edge:
     model = {

+ 3 - 3
preset/app/19_handWrittenDigiRecognition.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 from maix import camera
 from maix import display
 
@@ -12,7 +12,7 @@ from maix.nn import decoder
 camera.camera.config(size=(320,240))
 
 ScreenOrientation = False
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 
 def lcdRotation(inputImg,rotationAngle):
     from maix import image

+ 3 - 3
preset/app/20_carLicensePlateRecognition.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 from time import time
 
 ScreenOrientation = False
@@ -91,7 +91,7 @@ else:
     CAMERAROTATE = +90
 def main():
     from maix import display, camera , image
-    image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+    image.load_freetype("/home/res/sans.ttf")
     app  = LPR()
     
     canvasImg = image.new(size = (240, 320))

+ 3 - 3
preset/app/21_maskDetection.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 from time import time
 from maix import display, camera,image
 
@@ -52,7 +52,7 @@ def lcdRotation(inputImg,rotationAngle):
     else:
         imgRotationAim = image.new(size = (320, 240))
     return imgRotationAim.draw_image(imageRotationBuffer.rotate(rotationAngle, adjust=1),0,0,alpha=1)
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 if ScreenOrientation:
     CAMERAROTATE = +180
 else:

+ 2 - 2
preset/app/22_gestureRecognition.py

@@ -1,12 +1,12 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
+#version    :       2023.04.04
 #language   :       en
 from time import time
 from maix import image
 
 ScreenOrientation = False
 
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 class Hand:
     mud_path = "/root/preset/model/hand_int8.mud"
     labels = ["0","1","2","3","4","5"]

+ 3 - 3
preset/app/23_fingerGuessing.py

@@ -1,9 +1,9 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 from time import time
 from maix import image
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 ScreenOrientation = False
 class Mora:
     mud_path = "/root/preset/model/mora_int8.mud"

+ 16 - 20
preset/app/24_connectWiFi.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2024.03.07
+#language   :       en
 from maix import camera, display, zbar, image
 import socket
 import os
@@ -17,7 +17,7 @@ key_B = BUTTON(8)
 key_C = BUTTON(13)
 key_D = BUTTON(7)
 ScreenOrientation = False
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 camera.camera.config(size=(320,240))
 def lcdRotation(inputImg,rotationAngle):
     from maix import image
@@ -31,7 +31,7 @@ def lcdRotation(inputImg,rotationAngle):
 def getPublicIp():
     import requests
     url = 'https://myip.ipip.net'
-    res = requests.get(url,verify=False).text.split(" ")
+    res = requests.get(url).text.split(" ")
     return res[1][3:]
 if ScreenOrientation:
     CAMERAROTATE = +180
@@ -78,14 +78,10 @@ def getWifiConnectState():
     return wifiInfo
 
 def getPrivateIp():
-    st = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
-    try:
-        st.connect(("10.255.255.255",1))
-        IP = st.getsockname()[0]
-    except Exception:
-        IP = "127.0.0.1"
-    finally:
-        st.close()
+    import os
+    cmd="ifconfig"
+    rec=os.popen(cmd).read()
+    IP=print(rec[[rec.find("inet addr:192.")+10:rec.find("  Bcast:192.")])
     return IP
 
 ssidInfo = ""
@@ -105,7 +101,7 @@ while True:
         startConnect=True
         #connectText = "Waitting for Connection..."
         #canvas.draw_string(10,40, ssidInfo+" "+str(len(ssidInfo))+" "+str(type(ssidInfo)), scale = 1.5, color = (0,0,0), thickness = 1)
-        canvas.draw_string(10,50, "正在连接WIFI,请等待...", scale = 1.5, color = (0,0,0), thickness = 1)
+        canvas.draw_string(10,50, "Waitting for Connection...", scale = 1.5, color = (0,0,0), thickness = 1)
         display.show(canvas)
     if startConnect==True:
         canvas_1 = image.new(size = (320, 320), color = (255,255,255), mode = "RGB")
@@ -127,9 +123,9 @@ while True:
                     # PublicIp=getPublicIp()
                     PrivateIP=getPrivateIp()
                     connectSuccessSig = True
-                connectText = "WiFi连接成功!"
-                # canvas.draw_string(10,80, "路由器公网IP:" + PublicIp, scale = 1.5, color = (0,0,0), thickness = 1)
-                canvas.draw_string(10,80, "局域网IP:" + PrivateIP, scale = 1.5, color = (0,0,0), thickness = 1)
+                connectText = "WiFi connection is successful"
+                # canvas.draw_string(10,80, "PrivateIP :" + PublicIp, scale = 1.5, color = (0,0,0), thickness = 1)
+                canvas.draw_string(10,80, "PrivateIP  :" + PrivateIP, scale = 1.5, color = (0,0,0), thickness = 1)
                 canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
                 ssidInfo=""
                 passwordInfo=""
@@ -155,12 +151,12 @@ while True:
                     ssidInfo = ""
                 else:
                     if runConnectSig== True:
-                        connectText = "正在连接WIFI,请等待..."
+                        connectText = "Waitting for Connection..."
                         runConnectSig= False
                     else:
                         passwordInfo = ""
                         ssidInfo = ""
-                        connectText = "WIFI连接失败!"
+                        connectText = "WiFi connection is failed"
                         canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
                 
         
@@ -181,8 +177,8 @@ while True:
             #画外框
             canvas.draw_rectangle(X, Y, X + W, Y + H, color=(0, 0, 255), thickness = 2) 
             #打印信息
-            canvas.draw_string(int(X) , int(Y - 45) , "WIFI名:"+ssidInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
-            canvas.draw_string(int(X) , int(Y - 25) , "密码:"+passwordInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+            canvas.draw_string(int(X) , int(Y - 45) , "SSID:"+ssidInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+            canvas.draw_string(int(X) , int(Y - 25) , "PASSWORD:"+passwordInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
     canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
     #canvas.draw_image((image.open("/root/preset/img/camera_bfbfbf_24x24.png")).rotate(0, adjust=0),292,2,alpha=1)
     display.show(canvas)

+ 77 - 77
preset/app/25_aboutCocoPi.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2024.03.13
-#language   :       ch
+#version    :       2024.01.01
+#language   :       en
 from maix import *
 import socket
 import os
@@ -15,7 +15,7 @@ key_B = BUTTON(8)
 key_C = BUTTON(13)
 key_D = BUTTON(7)
 #image.load_freetype("/root/preset/fonts/JetBrainsMono-Bold-7.ttf")
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 
 def getWifiConnectState():
     cmd = "wifi_get_connection_info_test 1"
@@ -60,75 +60,75 @@ PublicIp=""
 PrivateIP=""
 
 baseInfo=[
-        "--------------------------------------",
-        "     --- 设计 --- 创造 --- 分享 ---",
-        "--------------------------------------",
-        "                       系统信息         ",
+        "---------------------------",
+        " Design -- Create -- Share ",
+        "---------------------------",
+        "           SYSTEM          ",
         "***************************",
-        "系统名称:          CocoPi Linux",
-        "系统版本:              2024.01.01A",
-        "--------------------------------------",
-        "  用户名:                ",
-        "--------------------------------------",
-        "          网络信息         ",
+        "SystemName:    CocoPi Linux",
+        "SystemVersion:   2024.01.01",
+        "---------------------------",
+        "  USERNAME:                ",
+        "---------------------------",
+        "          Internet         ",
         "***************************",
         " ",
         " ",
         " ",
         " ",
-        "--------------------------------------",
-        "Python 版本                        3.8.5",
+        "---------------------------",
+        "Python Version        3.8.5",
         "***************************",
-        "Python 包信息                 版本号",
+        "Python Package      Version",
         "***************************",
-        "av                                                9.2.0",
-        "beautifulsoup4                4.11.1",
-        "certifi                              2020.6.20",
-        "cffi                                            1.14.3",
-        "chardet                                    3.0.4",
-        "click                                           7.1.2",
-        "defusedxml                           0.6.0",
-        "et-xmlfile                                1.0.1",
-        "evdev                                        1.4.0",
-        "Flask                                         1.1.2",
-        "Flask-Login                           0.5.0",
-        "gpiod                                        1.4.0",
-        "html5lib                                      1.1",
-        "idna                                            2.10",
-        "itsdangerous                        1.1.0",
-        "jdcal                                          1.4.1",
-        "jieba                                       0.42.1",
-        "Jinja2                                    2.11.2",
-        "lxml                                           4.5.2",
-        "maixpy3                                  0.5.4",
-        "MarkupSafe                           1.1.1",
-        "numpy                                   1.19.2",
-        "openpyxl                                 3.0.5",
-        "Pillow                                        7.2.0",
-        "pip                                           20.1.1",
-        "plumbum                               1.6.9",
-        "ply                                                3.11",
-        "pyasn1                                     0.4.8",
-        "PyAudio                                0.2.11",
-        "pycparser                                 2.20",
-        "pylibmodbus                        0.5.0",
-        "pyserial                                        3.4",
-        "qrcode                                          6.1",
-        "requests                               2.24.0",
-        "rpyc                                            5.0.1",
-        "rsa                                                  4.6",
-        "schedule                                0.6.0",
-        "setuptools                           47.1.0",
-        "six                                            1.15.0",
-        "smbus2                                   0.4.2",
-        "soupsieve                               2.3.1",
-        "spidev                                           3.5",
-        "SQLAlchemy                       1.3.18",
-        "urllib3                                  1.25.10",
-        "websocket-client                1.5.1",
-        "Werkzeug                                1.0.1",
-        "zbarlight                                      3.0",
-        "--------------------------------------",
+        "av                    9.2.0",
+        "beautifulsoup4       4.11.1",
+        "certifi           2020.6.20",
+        "cffi                 1.14.3",
+        "chardet               3.0.4",
+        "click                 7.1.2",
+        "defusedxml            0.6.0",
+        "et-xmlfile            1.0.1",
+        "evdev                 1.4.0",
+        "Flask                 1.1.2",
+        "Flask-Login           0.5.0",
+        "gpiod                 1.4.0",
+        "html5lib                1.1",
+        "idna                   2.10",
+        "itsdangerous          1.1.0",
+        "jdcal                 1.4.1",
+        "jieba                0.42.1",
+        "Jinja2               2.11.2",
+        "lxml                  4.5.2",
+        "maixpy3               0.5.4",
+        "MarkupSafe            1.1.1",
+        "numpy                1.19.2",
+        "openpyxl              3.0.5",
+        "Pillow                7.2.0",
+        "pip                  20.1.1",
+        "plumbum               1.6.9",
+        "ply                    3.11",
+        "pyasn1                0.4.8",
+        "PyAudio              0.2.11",
+        "pycparser              2.20",
+        "pylibmodbus           0.5.0",
+        "pyserial                3.4",
+        "qrcode                  6.1",
+        "requests             2.24.0",
+        "rpyc                  5.0.1",
+        "rsa                     4.6",
+        "schedule              0.6.0",
+        "setuptools           47.1.0",
+        "six                  1.15.0",
+        "smbus2                0.4.2",
+        "soupsieve             2.3.1",
+        "spidev                  3.5",
+        "SQLAlchemy           1.3.18",
+        "urllib3             1.25.10",
+        "websocket-client      1.5.1",
+        "Werkzeug              1.0.1",
+        "zbarlight               3.0",
+        "---------------------------",
     ]
 
 ownerName=""
@@ -137,33 +137,33 @@ try:
         ownerName=f.read()
 except:
     ownerName="N/A"
-baseInfo[8]="{: <28}".format("用户名:     "+ownerName)
+baseInfo[8]="{: <28}".format("USERNAME:     "+ownerName)
 canvas = image.new(size=(320, 240),color = (15,21,46),mode = "RGB")
-canvas.draw_string(12 , 100 , "检查WIFI连接状态...", scale = 1, color = (255,255,255), thickness = 2)
+canvas.draw_string(12 , 100 , "Checking Wi-Fi connection", scale = 1, color = (255,255,255), thickness = 2)
 display.show(canvas)
 checkInternet=False
 try:
     if getWifiConnectState()["state"]==True:
         PublicIp=getPublicIp()
         PrivateIP=getPrivateIp()
-        baseInfo[12]="{: <28}".format("路由器公网IP:"+PublicIp)
-        baseInfo[13]="{: <28}".format("局域网IP:"+PrivateIP)
-        baseInfo[14]="{: <28}".format("WIFI热点名:"+getWifiConnectState()["AP"])
-        baseInfo[15]="{: <28}".format("WIFI信号强度:"+getWifiConnectState()["RSSI"])
+        baseInfo[12]="{: <28}".format("PublicIP:"+PublicIp)
+        baseInfo[13]="{: <28}".format("PrivateIP:"+PrivateIP)
+        baseInfo[14]="{: <28}".format("WIFI AP:"+getWifiConnectState()["AP"])
+        baseInfo[15]="{: <28}".format("WIFI RSSI:"+getWifiConnectState()["RSSI"])
     else:
         PublicIp="N/A"
         PrivateIP="N/A"
-        baseInfo[12]="{: <28}".format("路由器公网IP:    N/A")
-        baseInfo[13]="{: <28}".format("局域网IP:   N/A")
-        baseInfo[14]="{: <28}".format("WIFI热点名:    N/A")
+        baseInfo[12]="{: <28}".format("PublicIP:    N/A")
+        baseInfo[13]="{: <28}".format("PrivateIP:   N/A")
+        baseInfo[14]="{: <28}".format("WIFI AP:    N/A")
         baseInfo[15]="{: <28}".format("WIFI RSSI:   N/A")
 except:
     PublicIp="N/A"
     PrivateIP="N/A"
-    baseInfo[12]="{: <28}".format("路由器公网IP:    N/A")
-    baseInfo[13]="{: <28}".format("局域网IP:   N/A")
-    baseInfo[14]="{: <28}".format("WIFI热点名:    N/A")
-    baseInfo[15]="{: <28}".format("WIFI信号强度:   N/A")
+    baseInfo[12]="{: <28}".format("PublicIP:    N/A")
+    baseInfo[13]="{: <28}".format("PrivateIP:   N/A")
+    baseInfo[14]="{: <28}".format("WIFI AP:    N/A")
+    baseInfo[15]="{: <28}".format("WIFI RSSI:   N/A")
     pass
 
 xPosition=48

+ 6 - 6
preset/app/26_internetCamera.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       pi
+#version    :       2023.04.03
+#language   :       en
 from maix import image     #引入python模块包
 from maix import camera, mjpg, utils, display
 import time
@@ -32,10 +32,10 @@ def getPrivateIp():
         st.close()
     return IP
 
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 PrivateIP=""
 canvas = image.new(size=(320, 240),color = (15,21,46),mode = "RGB")
-canvas.draw_string(8 , 100 , "检查网络连接状态...", scale = 1, color = (255,255,255), thickness = 1)
+canvas.draw_string(8 , 100 , "Checking Wi-Fi connection", scale = 1, color = (255,255,255), thickness = 1)
 display.show(canvas)
 wirelessTransmitPath=" "
 
@@ -47,9 +47,9 @@ try:
         wirelessTransmitPath=pathHead+PrivateIP+pathTail
     else:
         PrivateIP="N/A"
-        wirelessTransmitPath="请先连接网络"
+        wirelessTransmitPath="Please connect the Internet."
 except:
-    wirelessTransmitPath="请先连接网络"
+    wirelessTransmitPath="Please connect the Internet."
     pass
 
 os.system("rm /root/user/img/wirelessPictureTransmit.jpg")

+ 14 - 13
preset/app/27_internetWeatherPrediction.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.03
+#language   :       en
 from maix import display
 from maix import image
 from maix import camera
@@ -12,7 +12,8 @@ import http.client
 camera.camera.config(size=(320,240))
 
 ScreenOrientation = False
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 
 def get_content(city):
     weather_list = []
@@ -37,7 +38,7 @@ def get_content(city):
 # https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/weatherdata/forecast?locations=Herndon,VA,20170&aggregateHours=24&unitGroup=us&shortColumnNames=false&contentType=csv&key=YOURAPIKEY
 
 canvas = image.new(size=(320, 240),color = (15,21,46),mode = "RGB")
-canvas.draw_string(4 , 100 , "正在检查网络连接状态...", scale = 1, color = (255,255,255), thickness = 2)
+canvas.draw_string(4 , 100 , "Checking Wi-Fi connection", scale = 1, color = (255,255,255), thickness = 2)
 display.show(canvas)
 weather_all1 = get_content('shenzhen')
 weather_all2 = get_content('HongKong')
@@ -48,19 +49,19 @@ while True:
     try:
         canvas = image.new(size=(320, 240),color = (15,21,46),mode = "RGB")
         #canvas.draw_string(2,20, ("Day:"+str(weather_all1[0]["D"])), scale = 1, color = (255,255,255) , thickness = 1)
-        canvas.draw_string(2,20, ("气象变化:"+str(weather_all1[0]["W"])+"  ,温度:"+str(weather_all1[0]["T"]))[:-1]+"℃", scale = 1, color = (255,255,255) , thickness = 1)
-        canvas.draw_string(0,0, "深圳", scale = 1, color = (255,255,255) , thickness = 1)
-        canvas.draw_string(0,60, "香港", scale = 1, color = (255,255,255) , thickness = 1)
+        canvas.draw_string(2,20, ("W/W:"+str(weather_all1[0]["W"])+"  ,T:"+str(weather_all1[0]["T"]))[:-1]+"'C", scale = 1, color = (255,255,255) , thickness = 1)
+        canvas.draw_string(0,0, "Shenzhen", scale = 1, color = (255,255,255) , thickness = 1)
+        canvas.draw_string(0,60, "Hong Kong", scale = 1, color = (255,255,255) , thickness = 1)
         #canvas.draw_string(2,80, ("Day:"+str(weather_all2[0]["D"])), scale = 1, color = (255,255,255) , thickness = 1)
-        canvas.draw_string(2,80, ("气象变化:"+str(weather_all2[0]["W"])+"  ,温度:"+str(weather_all2[0]["T"]))[:-1]+"℃", scale = 1, color = (255,255,255) , thickness = 1)
-        canvas.draw_string(0,120, "澳门", scale = 1, color = (255,255,255) , thickness = 1)
+        canvas.draw_string(2,80, ("W/W:"+str(weather_all2[0]["W"])+"  ,T:"+str(weather_all2[0]["T"]))[:-1]+"'C", scale = 1, color = (255,255,255) , thickness = 1)
+        canvas.draw_string(0,120, "Macau", scale = 1, color = (255,255,255) , thickness = 1)
         #canvas.draw_string(2,140, ("Day:"+str(weather_all3[0]["D"])), scale = 1, color = (255,255,255) , thickness = 1)
-        canvas.draw_string(2,140, ("气象变化:"+str(weather_all3[0]["W"])+"  ,温度:"+str(weather_all3[0]["T"]))[:-1]+"℃", scale = 1, color = (255,255,255) , thickness = 1)
-        canvas.draw_string(0,180, "广州", scale = 1, color = (255,255,255) , thickness = 1)
+        canvas.draw_string(2,140, ("W/W:"+str(weather_all3[0]["W"])+"  ,T:"+str(weather_all3[0]["T"]))[:-1]+"'C", scale = 1, color = (255,255,255) , thickness = 1)
+        canvas.draw_string(0,180, "Guangzhou", scale = 1, color = (255,255,255) , thickness = 1)
         #canvas.draw_string(2,200, ("Day:"+str(weather_all4[0]["D"])), scale = 1, color = (255,255,255) , thickness = 1)
-        canvas.draw_string(2,200, ("气象变化:"+str(weather_all4[0]["W"])+"  ,温度:"+str(weather_all4[0]["T"]))[:-1]+"℃",scale = 1, color = (255,255,255) , thickness = 1)
+        canvas.draw_string(2,200, ("W/W:"+str(weather_all4[0]["W"])+"  ,T:"+str(weather_all4[0]["T"]))[:-1]+"'C",scale = 1, color = (255,255,255) , thickness = 1)
     except:
-        canvas.draw_string(20,80, "获取天气信息失败!", scale = 1, color = (255,255,255) , thickness = 1)
+        canvas.draw_string(20,80, "Get weather information failed!", scale = 1, color = (255,255,255) , thickness = 1)
     if ScreenOrientation:
         canvasVER = canvas.crop(0,0,240,320)
         canvasVER = canvasVER.rotate(-90, adjust=1)

+ 4 - 5
preset/app/28_internetTimeClock.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 
 import os
 from maix import display
@@ -38,7 +38,7 @@ def getNetworkDate_noexit():
 camera.camera.config(size=(320,240))
 
 ScreenOrientation = False
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/DigitalNumbers-Regular.ttf")
 
 def getNetworkDate():
     try:
@@ -119,7 +119,7 @@ def screenShow(inputImg,rotationAngle):
 
 
 canvas = image.new(size=(320, 240),color = (15,21,46),mode = "RGB")
-canvas.draw_string(8 , 100 , "正在检查网络连接状态...", scale = 1, color = (209,72,54), thickness = 1)
+canvas.draw_string(8 , 100 , "Checking Wi-Fi connection", scale = 1, color = (209,72,54), thickness = 1)
 display.show(canvas)
 
 #os.system("wifi_disconnect_ap_test")
@@ -130,7 +130,6 @@ getNetworkDate_noexit()
 canvas = image.new(size = (320, 240))
 getNetworkDate()
 weather = get_content('http://www.weather.com.cn/weather1d/101280601.shtml')
-image.load_freetype("/root/preset/fonts/DigitalNumbers-Regular.ttf")
 while True:
     time.sleep(1)
     canvas.clear()

+ 6 - 6
preset/app/29_environmentDetection.py

@@ -1,12 +1,12 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.04.04
+#language   :       en
 import sys
 import time
 from maix import display,image,camera
 sys.path.append('/root/')
 from CocoPi import AHT20
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
 
 class v83x_ADC():
     def __init__(self, addr=b"0x05070080") -> None:
@@ -34,8 +34,8 @@ def aht20Test():
     from maix import display
     h=round(aht20.get_humidity(),2)+10.00
     t=round(aht20.get_temperature()-15,2)
-    img_backdrop.draw_string(16, 108, "原始湿度值:"+str(h)+"RH%", scale = 1.0,color = (0, 255, 0), thickness = 1)
-    img_backdrop.draw_string(16, 132, "原始温度值:"+str(t)+"℃", scale = 1.0,color = (0, 255, 0), thickness = 1)
+    img_backdrop.draw_string(16, 108, "Original humidity value:"+str(h)+"RH%", scale = 1.0,color = (0, 255, 0), thickness = 1)
+    img_backdrop.draw_string(16, 132, "Original temperature value:"+str(t)+"'C", scale = 1.0,color = (0, 255, 0), thickness = 1)
     
 
 
@@ -47,7 +47,7 @@ while True:
     img_backdrop = image.new(size=(320, 240),color = (15,21,46),mode = "RGB")
     aht20Test()
     v=v831_adc0.value()
-    img_backdrop.draw_string(16, 84, "原始光照强度值:"+str(v), scale = 1.0,color = (0, 255, 0), thickness = 1)
+    img_backdrop.draw_string(16, 84, "Original light intensity value:"+str(v), scale = 1.0,color = (0, 255, 0), thickness = 1)
     img_backdrop.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
     display.show(img_backdrop)
     time.sleep(0.5)

+ 13 - 13
preset/app/30_training_data_collect.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.05.05
+#language   :       en
 
 from maix import camera, display, zbar, image
 import socket
@@ -105,7 +105,7 @@ while True:
         startConnectWifi=True
         #connectText = "Waitting for Connection..."
         #canvas.draw_string(10,40, ssidInfo+" "+str(len(ssidInfo))+" "+str(type(ssidInfo)), scale = 1.5, color = (0,0,0), thickness = 1)
-        canvas.draw_string(10,50, "正在连接WIFI,请等待...", scale = 1.5, color = (0,0,0), thickness = 1)
+        canvas.draw_string(10,50, "Waitting for Connection...", scale = 1.5, color = (0,0,0), thickness = 1)
         display.show(canvas)
     if startConnectWifi==True:
         canvas_1 = image.new(size = (320, 320), color = (255,255,255), mode = "RGB")
@@ -127,9 +127,9 @@ while True:
                     # PublicIp=getPublicIp()
                     PrivateIP=getPrivateIp()
                     connectSuccessSig = True
-                connectText = "WiFi连接成功!"
-                canvas.draw_string(10,50, "WiFi连接成功!", scale = 1.5, color = (0,0,0) , thickness = 1)
-                canvas.draw_string(10,80, "局域网IP:" + PrivateIP, scale = 1.5, color = (0,0,0), thickness = 1)
+                connectText = "WiFi connection is successful"
+                canvas.draw_string(10,50, "WiFi connection is successful", scale = 1.5, color = (0,0,0) , thickness = 1)
+                canvas.draw_string(10,80, "PrivateIP  :" + PrivateIP, scale = 1.5, color = (0,0,0), thickness = 1)
                 canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
                 ssidInfo=""
                 passwordInfo=""
@@ -160,12 +160,12 @@ while True:
                     ssidInfo = ""
                 else:
                     if runConnectSig== True:
-                        connectText = "正在连接WIFI,请等待..."
+                        connectText = "Waitting for Connection..."
                         runConnectSig= False
                     else:
                         passwordInfo = ""
                         ssidInfo = ""
-                        connectText = "WIFI连接失败!"
+                        connectText = "WiFi connection is failed"
                         canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
                 
         
@@ -186,8 +186,8 @@ while True:
             #画外框
             canvas.draw_rectangle(X, Y, X + W, Y + H, color=(0, 0, 255), thickness = 2) 
             #打印信息
-            canvas.draw_string(int(X) , int(Y - 45) , "WIFI名:"+ssidInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
-            canvas.draw_string(int(X) , int(Y - 25) , "密码:"+passwordInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+            canvas.draw_string(int(X) , int(Y - 45) , "SSID:"+ssidInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+            canvas.draw_string(int(X) , int(Y - 25) , "PASSWORD:"+passwordInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
     canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
     #canvas.draw_image((image.open("/root/preset/img/camera_bfbfbf_24x24.png")).rotate(0, adjust=0),292,2,alpha=1)
     display.show(canvas)
@@ -231,8 +231,8 @@ while True:
             #打印信息
             canvas.draw_string(int(X) , int(Y - 35) , str(string), scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
 
-    canvas.draw_string(0, 0 , "扫描二维码来访问图片标注服务器", scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
-    canvas.draw_string(0, 20 , "", scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+    canvas.draw_string(0, 0 , "Scann the QRcode to Connect the", scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+    canvas.draw_string(0, 20 , "Image Tagging Server", scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
     # canvas.draw_image((image.open("/root/preset/img/camera_ff0000_24x24.png")).rotate(0, adjust=0),290,2,alpha=1)
     canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),290,208,alpha=1)
         
@@ -250,7 +250,7 @@ while True:
                 save_path = ''.join([str(x) for x in ["/root/user/img/image", str(image_num), ".jpg"]])
                 canvas1.save(save_path)
                 isAlTake = True
-            canvas1.draw_string(0, 0 , "请拍照来采集图片数据", scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+            canvas1.draw_string(0, 0 , "Please take a photo", scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
             canvas1.draw_image((image.open("/root/preset/img/camera_ff0000_24x24.png")).rotate(0, adjust=0),290,2,alpha=1)
             canvas1.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),290,208,alpha=1)
             display.show(canvas1)

+ 11 - 11
preset/app/31_training_deploy_model.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.05.05
+#language   :       en
 
 from maix import camera, display, zbar, image
 import socket
@@ -68,8 +68,8 @@ def urldownload(url,filepath=None,filename=None,canvas1=image.new(size = (320, 4
             now_jd = (data_count / content_size) * 100
             # print("\r 文件下载进度:%d%%(%d/%d) - %s" % (now_jd, data_count, content_size, filename), end=" ")
             canvas1.clear()
-            canvas1.draw_string(0,0,str("下载中: ") + filename, scale = 1, color = (255, 0, 0), thickness = 2)
-            canvas1.draw_string(0,20 , str("进度: %d%%(%d/%d)" % (now_jd, data_count, content_size)), scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+            canvas1.draw_string(0,0,str("Downloading: ") + filename, scale = 1, color = (255, 0, 0), thickness = 2)
+            canvas1.draw_string(0,20 , str("Progress: %d%%(%d/%d)" % (now_jd, data_count, content_size)), scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
             display.show(canvas1)
             # time.sleep(1)
 
@@ -132,7 +132,7 @@ while True:
         startConnectWifi=True
         #connectText = "Waitting for Connection..."
         #canvas.draw_string(10,40, ssidInfo+" "+str(len(ssidInfo))+" "+str(type(ssidInfo)), scale = 1.5, color = (0,0,0), thickness = 1)
-        canvas.draw_string(10,50, "正在连接WIFI...", scale = 1.5, color = (0,0,0), thickness = 1)
+        canvas.draw_string(10,50, "Waitting for Connection...", scale = 1.5, color = (0,0,0), thickness = 1)
         display.show(canvas)
     if startConnectWifi==True:
         canvas_1 = image.new(size = (320, 320), color = (255,255,255), mode = "RGB")
@@ -154,9 +154,9 @@ while True:
                     # PublicIp=getPublicIp()
                     PrivateIP=getPrivateIp()
                     connectSuccessSig = True
-                connectText = "WiFi连接成功!"
-                canvas.draw_string(10,50, "WiFi连接成功!", scale = 1.5, color = (0,0,0) , thickness = 1)
-                canvas.draw_string(10,80, "局域网IP地址:" + PrivateIP, scale = 1.5, color = (0,0,0), thickness = 1)
+                connectText = "WiFi connection is successful"
+                canvas.draw_string(10,50, "WiFi connection is successful", scale = 1.5, color = (0,0,0) , thickness = 1)
+                canvas.draw_string(10,80, "PrivateIP  :" + PrivateIP, scale = 1.5, color = (0,0,0), thickness = 1)
                 canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
                 ssidInfo=""
                 passwordInfo=""
@@ -186,12 +186,12 @@ while True:
                     ssidInfo = ""
                 else:
                     if runConnectSig== True:
-                        connectText = "正在连接WIFI..."
+                        connectText = "Waitting for Connection..."
                         runConnectSig= False
                     else:
                         passwordInfo = ""
                         ssidInfo = ""
-                        connectText = "WiFi连接失败!"
+                        connectText = "WiFi connection is failed"
                         canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
                 
         
@@ -254,7 +254,7 @@ while True:
             #打印信息
             canvas.draw_string(int(X) , int(Y - 35) , str(string), scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
                 
-    canvas.draw_string(0, 0 , "扫描二维码来下载模型", scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+    canvas.draw_string(0, 0 , "Photo scanning code download model", scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
     # canvas.draw_image((image.open("/root/preset/img/camera_ff0000_24x24.png")).rotate(0, adjust=0),280,2,alpha=1)
     canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),290,208,alpha=1)
     display.show(canvas)

+ 4 - 3
preset/app/32_mnistModelTraining.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.09.07
+#language   :       en
 import time
 from maix import camera, display, image
 import os
@@ -13,7 +13,8 @@ key_B = BUTTON(8)
 key_C = BUTTON(13)
 key_D = BUTTON(7)
 
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+#image.load_freetype("/root/preset/fonts/CascadiaCodePL-Italic.ttf")
+image.load_freetype("/root/preset/fonts/simhei.ttf")
 
 import numpy as np
 

+ 2 - 2
preset/app/33_mnistCameraTest.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.09.07
+#language   :       en
 from maix import camera
 from maix import display
 from maix import image

+ 11 - 12
preset/app/34_CocoGPT.py

@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-#version    :       2024.08.08
+#version    :       2023.09.07
 #language   :       en
 from maix import display
 from maix import image
@@ -14,7 +14,6 @@ from evdev import InputDevice, categorize, ecodes
 import os
 import sys
 sys.path.append("/root/")
-sys.path.append("/root/preset/drivers/pylib/")
 from CocoPi import BUTTON
 
 camera.camera.config(size=(320,240))
@@ -27,7 +26,7 @@ except:
     keyboard = ""
 
 if keyboard=="":
-    canvas.draw_string(0,12, "未检测到键盘", scale = 1.3, color = (255,255,255) , thickness = 1)
+    canvas.draw_string(0,12, "Keyboard not detected", scale = 1.3, color = (255,255,255) , thickness = 1)
     display.show(canvas)
     time.sleep(3)
     sys.exit()
@@ -75,7 +74,7 @@ def get_post_chatgpt(datas):
 ScreenOrientation = False
 _canvas_x = 0
 _canvas_y = 0
-keyboardStr = ["请输入:",""]
+keyboardStr = ["Enter here:",""]
 list_num = 1
 # 判断是否联网
 key_B = BUTTON(8)
@@ -115,7 +114,7 @@ while True:
             startConnect=True
             #connectText = "Waitting for Connection..."
             #canvas.draw_string(10,40, ssidInfo+" "+str(len(ssidInfo))+" "+str(type(ssidInfo)), scale = 1.5, color = (0,0,0), thickness = 1)
-            canvas.draw_string(10,50, "正在连接WIFI,请等待...", scale = 1.5, color = (0,0,0), thickness = 1)
+            canvas.draw_string(10,50, "Connecting to wifi...", scale = 1.5, color = (0,0,0), thickness = 1)
             display.show(canvas)
         if startConnect==True:
             canvas_1 = image.new(size = (320, 320), color = (255,255,255), mode = "RGB")
@@ -138,7 +137,7 @@ while True:
                         connectSuccessSig = True
                     connectText = "Wifi connection successfully!"
                     # canvas.draw_string(10,80, "The WLAN PUBLIC IP:" + PublicIp, scale = 1.5, color = (0,0,0), thickness = 1)
-                    canvas.draw_string(10,110, "局域网IP:" + PrivateIP, scale = 1.5, color = (0,0,0), thickness = 1)
+                    canvas.draw_string(10,110, "THE WLAN PRIVATE IP:" + PrivateIP, scale = 1.5, color = (0,0,0), thickness = 1)
                     # canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
                     ssidInfo=""
                     passwordInfo=""
@@ -165,12 +164,12 @@ while True:
                         ssidInfo = ""
                     else:
                         if runConnectSig== True:
-                            connectText = "正在连接WIFI,请等待..."
+                            connectText = "Connecting to wifi,please wait..."
                             runConnectSig= False
                         else:
                             passwordInfo = ""
                             ssidInfo = ""
-                            connectText = "WIFI连接失败!"
+                            connectText = "Wifi connection failed!"
                             canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
                     
             
@@ -191,12 +190,12 @@ while True:
                 #画外框
                 canvas.draw_rectangle(X, Y, X + W, Y + H, color=(0, 0, 255), thickness = 2) 
                 #打印信息
-                canvas.draw_string(int(X) , int(Y - 45) , "WIFI名:"+ssidInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
-                canvas.draw_string(int(X) , int(Y - 25) , "密码:"+passwordInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+                canvas.draw_string(int(X) , int(Y - 45) , "wifi name:"+ssidInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
+                canvas.draw_string(int(X) , int(Y - 25) , "password:"+passwordInfo, scale = 1, color = (255, 0, 0), thickness = 2)  #内框ID
         canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
         v831_display_show_canvas(canvas)
 # 键盘事件
-canvas.draw_string(0,0, str("请输入:"), scale = 1, color = (255,255,255) , thickness = 1)
+canvas.draw_string(0,0, str("Enter here:"), scale = 1, color = (255,255,255) , thickness = 1)
 v831_display_show_canvas(canvas)
 for event in keyboard.read_loop():
     if event.type == ecodes.EV_KEY:
@@ -226,6 +225,6 @@ for event in keyboard.read_loop():
             else:
                 for i in range(list_num+1):
                     canvas.draw_string(0,15*i, str(keyboardStr[i]), scale = 1, color = (255,255,255) , thickness = 1)
-            canvas.draw_string(0,0, str("请输入:"), scale = 1, color = (255,255,255) , thickness = 1)
+            canvas.draw_string(0,0, str("Enter here:"), scale = 1, color = (255,255,255) , thickness = 1)
             v831_display_show_canvas(canvas)
 

+ 3 - 3
preset/app/35_CocoTerminal.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#version    :       2023.12.31
-#language   :       ch
+#version    :       2023.09.07
+#language   :       en
 from evdev import InputDevice, categorize, ecodes
 import asyncio
 import pty
@@ -27,7 +27,7 @@ except:
     keyboard = ""
 
 if keyboard=="":
-    canvas.draw_string(0,12, "未检测到键盘", scale = 1.3, color = (255,255,255) , thickness = 1)
+    canvas.draw_string(0,12, "Keyboard not detected", scale = 1.3, color = (255,255,255) , thickness = 1)
     display.show(canvas)
     time.sleep(3)
     sys.exit()

+ 9 - 3
preset/app/36_pictureAnalysis.py

@@ -1,3 +1,9 @@
+#!/usr/bin/env python
+#version    :       2024.03.13
+#language   :       en
+#hardware   :       PI
+#camera     :       CR5205
+
 from maix import display
 from maix import image
 from maix import camera
@@ -106,7 +112,7 @@ def getImage():
             {
                 "role": "user",
                 "content":[
-                    {"text": "图片讲述了什么?","type": "text"},
+                    {"text": "What does the film talk about?","type": "text"},
                     {"image_url": {"url": f"data:image/jpeg;base64,{strBase}"},"type": "image_url"}
                 ]
             }
@@ -122,10 +128,10 @@ def getImage():
         if res.status_code == 200:
             isStateVoice = 3
             aa = json.loads(res.text)["FunctionResponse"]["choices"][0]["message"]["content"]
-            result_num = len(aa)//20
+            result_num = len(aa)//45
             for i in range(result_num + 1):
                 imgUrlStr.append("")
-                imgUrlStr[i] = str(aa)[i*20:(i+1)*20]
+                imgUrlStr[i] = str(aa)[i*45:(i+1)*45]
             
             url = "https://gpt4.cocorobo.cn/getV831Audio"
             payload = json.dumps({"input": aa,"response_format":"mp3","voice": "shimmer","uid":uid})

+ 10 - 6
preset/app/37_speechToImageSynthesis.py

@@ -1,3 +1,7 @@
+#!/usr/bin/env python
+#version    :       2024.03.07
+#language   :       en
+
 from maix import display
 from maix import image
 from maix import camera
@@ -22,7 +26,7 @@ key_B = BUTTON(8)
 key_C = BUTTON(13)
 key_D = BUTTON(7)
 camera.camera.config(size=(320,240))
-image.load_freetype("/root/preset/fonts/SourceHanSansCN-Regular.otf")
+image.load_freetype("/root/preset/fonts/simhei.ttf")
 canvas = image.new(size = (320, 240))
 # 录音
 WAVE_OUTPUT_FILENAME = "/root/user/audio/record.wav"
@@ -195,7 +199,7 @@ while True:
             startConnect=True
             #connectText = "Waitting for Connection..."
             #canvas.draw_string(10,40, ssidInfo+" "+str(len(ssidInfo))+" "+str(type(ssidInfo)), scale = 1.5, color = (0,0,0), thickness = 1)
-            canvas.draw_string(10,50, "正在连接WiFi...", scale = 1.5, color = (0,0,0), thickness = 1)
+            canvas.draw_string(10,50, "Connecting to wifi...", scale = 1.5, color = (0,0,0), thickness = 1)
             display.show(canvas)
         if startConnect==True:
             canvas_1 = image.new(size = (320, 320), color = (255,255,255), mode = "RGB")
@@ -218,7 +222,7 @@ while True:
                         connectSuccessSig = True
                     connectText = "Wifi connection successfully!"
                     # canvas.draw_string(10,80, "The WLAN PUBLIC IP:" + PublicIp, scale = 1.5, color = (0,0,0), thickness = 1)
-                    canvas.draw_string(10,110, "局域网IP:" + PrivateIP, scale = 1.5, color = (0,0,0), thickness = 1)
+                    canvas.draw_string(10,110, "THE WLAN PRIVATE IP:" + PrivateIP, scale = 1.5, color = (0,0,0), thickness = 1)
                     # canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
                     ssidInfo=""
                     passwordInfo=""
@@ -245,12 +249,12 @@ while True:
                         ssidInfo = ""
                     else:
                         if runConnectSig== True:
-                            connectText = "正在连接WiFi,请等待..."
+                            connectText = "Connecting to wifi,please wait..."
                             runConnectSig= False
                         else:
                             passwordInfo = ""
                             ssidInfo = ""
-                            connectText = "WiFi连接失败!"
+                            connectText = "Wifi connection failed!"
                             canvas.draw_image((image.open("/root/preset/img/restart_ff0000_24x24.png")).rotate(0, adjust=0),8,216,alpha=1)
                     
             
@@ -289,7 +293,7 @@ while True:
         imgUrlStr = ""
     if isStateVoice == 2:
         canvas.clear()
-        canvas.draw_string(0,0, "图片生成中...", scale = 1, color = (0,255,255) , thickness = 1)
+        canvas.draw_string(0,0, "Picture generation in...", scale = 1, color = (0,255,255) , thickness = 1)
     elif isStateVoice != 2 and isStateVoice != 1:
         canvas.clear()
         if len(imgUrlStr)>0:

+ 1 - 1
preset/app/38_jumpbot.py

@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #version    :       2024.03.11
-#language   :       ch
+#language   :       en
 #hardware   :       PI
 
 import threading

+ 2 - 14
preset/app/git.py

@@ -74,10 +74,10 @@ def checkout(localRep, branch, progStream=None):
         porcelain.checkout_branch(r, 'origin/' + branch, outstream=progStream)
 
 
-def pull(localRep, progStream=None, depth=3):
+def pull(repo_path, progStream=None, depth=3):
     if progStream is None:
         progStream = NoneStream()
-    porcelain.pull(localRep, refspecs=porcelain.active_branch(localRep), outstream=progStream, depth=depth)
+    porcelain.pull(repo_path, refspecs=porcelain.active_branch(repo_path), outstream=progStream, depth=depth)
 
 
 def reset(localRep):
@@ -111,18 +111,6 @@ def isOnline(localRep):
     except Exception as e:
         # print(f"Connection failed: {e}")
         return False
-    
-def swRemote(localRep, remote_url):
-    r = Repo(localRep)
-    porcelain.remote_remove(r,'origin')
-    porcelain.remote_add(r,'origin',remote_url)
-
-def swRemote_force(localRep, remote_url):
-    r = Repo(localRep)
-    porcelain.remote_remove(r,'origin')
-    porcelain.remote_add(r,'origin',remote_url)
-    porcelain.fetch(localRep)
-    porcelain.pull(localRep, refspecs=porcelain.active_branch(localRep), force=True)
 
 
 if __name__ == '__main__':

+ 4 - 4
preset/app/ota.py

@@ -1,5 +1,5 @@
-import os
-
-os.system('chmod -R 777 /home')
-os.system('rsync -r --checksum /home/backup/ /root')
+import os
+
+os.system('chmod -R 777 /home')
+os.system('rsync -r --checksum /home/backup/ /root')
 os.system("ps | grep main.py | grep -v grep | awk '{print $1}' | xargs kill")

+ 23 - 23
preset/app/reset.py

@@ -1,23 +1,23 @@
-localrep = "/home/backup"
-otaPath = "/root/preset/app/ota.py"
-
-from maix import camera, display, image
-
-image.load_freetype("/root/preset/fonts/simhei.ttf")
-hello_img = image.new(size=(320, 240), color=(0, 0, 0), mode="RGB")
-hello_img.draw_string(10, 115, 'Reset', scale=1.0, color=(255, 255, 255), thickness=1)
-display.show(hello_img)
-
-import git
-
-git.rw()
-git.reset(localrep)
-hello_img = image.new(size=(320, 240), color=(0, 0, 0), mode="RGB")
-hello_img.draw_string(10, 115, 'Reconstruct directory', scale=1.0, color=(255, 255, 255), thickness=1)
-display.show(hello_img)
-
-with open(otaPath) as f:
-    code = f.read()
-exec(code)
-
-git.ro()
+localrep = "/home/backup"
+otaPath = "/root/preset/app/ota.py"
+
+from maix import camera, display, image
+
+image.load_freetype("/root/preset/fonts/simhei.ttf")
+hello_img = image.new(size=(320, 240), color=(0, 0, 0), mode="RGB")
+hello_img.draw_string(10, 115, 'Reset', scale=1.0, color=(255, 255, 255), thickness=1)
+display.show(hello_img)
+
+import git
+
+git.rw()
+git.reset(localrep)
+hello_img = image.new(size=(320, 240), color=(0, 0, 0), mode="RGB")
+hello_img.draw_string(10, 115, 'Reconstruct directory', scale=1.0, color=(255, 255, 255), thickness=1)
+display.show(hello_img)
+
+with open(otaPath) as f:
+    code = f.read()
+exec(code)
+
+git.ro()