sipeed / maixpy-v1_scripts Goto Github PK
View Code? Open in Web Editor NEWmicropython scripts for MaixPy
Home Page: https://maixpy.sipeed.com
License: MIT License
micropython scripts for MaixPy
Home Page: https://maixpy.sipeed.com
License: MIT License
Hi, I'd like to know how to create my own custom object detector model. I tested the "face-detector" with a different tiny YOLOv2 model but it didn't work. Any repo I can check to find more infos?
Thanks!
I'm using the demo_send_pic.py demo and I wanted to send an image compressed quality=80 but I got errors:
esp32_spi_wait_spi_char START_CMD error
esp32_spi_socket_write: get resp error!
[MaixPy] esp32_socket_send | send data failed
[Errno 5] EIO
I tried to modify the server script putting a time.sleep(0.025) in the receive and now I can send a quality 50 compressed image. Why?
I am trying to run the face recognition example, however I am facing an issue loading the following lines.
task_fd = kpu.load(0x200000)
task_fe = kpu.load(0x400000)
I am using M5StickV - K210, and loading the model from:
http://dl.sipeed.com/MAIX/MaixPy/model/face_model_at_0x300000.kfpkg
Am I loading the wrong model? Or is the M5StickV that do not support facerecognition?
Thank yoU!
Hi everyone,
I am using a Maixduino board flashed with its latest firmware maixpy_v0.5.0_98_g7ec09ea.bin
I was trying to implement the same code as: https://github.com/sipeed/MaixPy_scripts/blob/master/network/demo_esp32_socket.py
in order to receive an image from the server ( which is Alice.jpg) and display it on my LCD.
while doing so, i get this error message: OSError: [Errno 116] ETIMEDOUT in the line 60: data = sock.recv(4096)
I successfully made a connection on my Wifi by changing the WIFI_SSID and WIFI_PASSWD.
When I run the touchscreen sample I just get a blank screen and in the terminal I get lines of
0 0 0
0 0 0
If I use the thumbwheel I get
{"w":320, "h":240, "type"="rgb565", "size":153600}
0 0 0.
I noticed in the FFT demo there are alternative pins called out. Might this also be the case for the touchscreen. Do you have any other suggestions. thanks
Hi,
I am just a newbie
I want to run face detection but I get error when I run :
$ task = kpu.load(0x00300000)
ERROR:
v=596458738, flag=-2096411809, arch=-1955282835, layer len=834782759, mem=-39249
0997, out cnt=-663129117
err: we only support V3 now, get V596458738
[MAIXPY]kpu: kpu_model_get_size error -3Traceback (most recent call last):
File "", line 1, in
ValueError: [MAIXPY]kpu: load error -2
How to burn model to this board
please help me
thanks
It would be better to have some samples to use the speaker, as Maix Go have a good-looking speaker hardware.
network/demo_wifi_ap_scan.py is not working at maixpy firmware v0.3.2.
please see below the comment.
#8 (comment)
hey, I noticed when I tried to change/check the cpu/kpu frequency that the cpufreq module doesn't seems to be working, I installed the maixpy_v0.3.2_full version, I don't think I have made anything wrong. Hope this problem will be fixed soon !
import cpufreq Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: no module named 'cpufreq'
Hello everyone. when I've seen many the document of MiaxPy, I could not find source code that about Access Point or Wifi Hotspot . Many of them are connect the wifi hotspot but doesn't make MaixPy itself Wifi hotspot. Does anyone help me about making access point please?
Thank you in advance.
I can connect to my MaixPy via serial cable and I get the MaixPy welcome screen, but it doesn't respond at all to my keystrokes. I'm running minicom on Linux Mint connected to /dev/ttyACM0 at 115200 with hardware and software flow control set to OFF, and the backspace key set to DEL, and Line wrap set to YES. I've tried the USB cable that came with the MaixPy and one of my own USB cables. I also tried using gtkterm instead of minicom. They all do the same thing: I get the MaixPy greeting screen and the MicroPython >>> prompt, but when I hit Enter or Ctrl-C or any other key nothing happens.
Here's what minicom looks like when I connect:
Welcome to minicom 2.7.1
OPTIONS: I18n
Compiled on Aug 13 2017, 15:25:34.
Port /dev/ttyACM0, 20:57:40
Press CTRL-A Z for help on special keys
| \ / | /\ |_ | \ \ / / | _ \ \ \ / /
| \ / | / \ | | \ V / | |) | \ _/ /
| | / | / /\ \ | | > < | / \ /
| | | | / __ \ | | / . \ | | | |
| _ | | _ | / / \ _\ |_| / / \ \ || |_|
Official Site:http://www.sipeed.com/
Wiki:http://maixpy.sipeed.com/
[MAIXPY]Pll0:freq:320666666
[MAIXPY]Pll1:freq:159714285
[MAIXPY]Flash:0xc8:0x17
[MAIXPY]:Spiffs Mount successful
[MAIXPY]LCD:init
MicroPython 3b5c45649-dirty on 2018-11-15; Sipeed_M1 with kendryte-k210
Type "help()" for more information.
Any idea how to fix this? Is something on my MaixPy not set correctly? Minicom over serial works fine with other boards such as my BeagleBone Black (using an FTDI USB-to-serial adapter). Thanks.
cannot play wav according to samples play_wav.py, error is wav init error. What's problem? thanks!
sensor.set_hmirror(1)
...
bbox = kpu.run_yolo2(task, img) # Run the detection routine
for i in bbox:
img.draw_rectangle(i.rect())
when running above codes, on the resulting image the horizontal position of rectangle is wrong, it is not mirrored as the "sensor.set_hmirror(1)"
The microphone array is generally used to complete the sound focus, but there is no example of outputting the focused sound in the current demo. Could you add it? Conveniently, I hope to achieve the most basic recording function, thank you!
Hi, there seems to be an issue with the touchscreen demo. I'm using the Maixpy IDE and it says that it can't find the touchscreen module.
cannot use the ultrasonic script provided in maix py official documentation. https://github.com/sipeed/MaixPy_scripts/blob/master/modules/grove/ultrasonic/measure.py
i just use the offical demo in your github link, but can't run well, so how to solve the problem with wifi problem?
looking forward to you reply, thx
Hi,
I'm following the instructions here:
https://github.com/sipeed/MaixPy_scripts/blob/master/machine_vision/doc/self_learning_classifier.md
I downloaded the encrypted model on address 0x300000 and flashed the latest firmware.
When I run the demo script it launches, but then after pressing the Boot button the first time, the camera freezes and nothing happens anymore. There is no output on the terminal as well, it just freezes everything.
I'm on a Maixduino
just as the title says, I just do not find a how to after the boot procedure execute a program, (in this case a simple menu in which you can select to run a file ("the mythical user defined script") with the:
////////////////(yes it should be # but....)
with open("/sd/SCRIPTS/"+cadena[x]) as f:
exec(f.read())
///////////////
my boot.py file:
import image, time, lcd #uos , sensor, ujson,
from Maix import GPIO
from machine import Timer
print("ESTAS en:")
os.getcwd()
print("que tiene:")
os.listdir()
print("en SCRIPTS hay:")
os.listdir('/sd/SCRIPTS')
print("en IMGS hay:")
os.listdir('/sd/IMGS')
time.sleep(0.1)
#Tim=Timer(Timer.TIMER0, Timer.CHANNEL0, mode=Timer.MODE_PERIODIC, period=1, unit=Timer.UNIT_MS, callback=on_timer, arg=on_timer, start=False, priority=1, div=0)
lcd.init(freq=680000, color=0x0000)
time.sleep(0.3)
relog=time.clock()
SWATT = image.Image(copy_to_fb=1)
#print(Tim)
#sys.version()
x=0
while x<1:
x=x+1
relog.tick()
SWATT.draw_string(25, 100, "SWATT 2.0", (236,36,255), 4)#, 0, 0, False, 0, 0, 0, 0, 0, 0)
lcd.display(SWATT)#9990 ROSA OBCURO, 0222 VERDE, 0555 verde+ 004;
time.sleep(0.7)
lcd.clear()
SWATT.clear()
SWATT.draw_string(75, 100, "SWATT 2.0", lcd.WHITE, 2)#, 0, 0, False)#, lcd.BLACK)
lcd.display(SWATT)
time.sleep(0.65)
lcd.clear()
SWATT.clear()
#import Main.py
with open('/sd/021menu.py') as f:#this does not works when booting, it works if I use the MaixpyIDE
exec(f.read(),globals())#
no need my mistake
I've tried to run /network/demo_wifi_ap_scan.py but I got the following error.
That error happens at this line
https://github.com/sipeed/MaixPy_scripts/blob/6928fe172a77402915850a27c6f8fe04a75b8223/network/demo_wifi_ap_scan.py#L7
I've used the latest firmware v0.3.2 and Maix Dan Doc board.
What is wrong?
Is there any chance of implementing the _onewire module on the K210?
When i want to run demo esp32_read adc.
I meet a problem with "AttributeError:'module'object has no attribute 'ESP32_SPI'.
I use maixpy_v0.3.2_full.bin
If I want to use a kmodel convert from yolo3 , the operators like" kpu.init_yolo2"、“kpu.run_yolo2” can't be use, do you have some other operators support yolo3 model?
While trying to setup a MaixDuino with the GroveShield V2, I am usuccessfully trying to access IO pins, i.e. a button and an LED.
I would expect the LED example code to light the Grove LED on D7, and the button code to yield if the button on D3 is pressed. Both is not the case.
>>> fm.register(board_info.LED_R,fm.fpioa.GPIOHS0,force=True)
1
>>> led_r = GPIO(GPIO.GPIOHS0, GPIO.OUT)
>>> led_r.value()
0
>>> led_r.value(1)
>>> led_r.value()
0
How can I access the digital pins with MaixPy?
Hi, I'm a beginner with sipeed maix boards, and I don't know how to add the demo Speech Reconizer in the Maixpy IDE, can someone help me?
Is there any reference code to connect WLAN using Maixduino?Thank you.
I want to make my MaixPy BIT to keep sending some data to PC which was connected using /dev/ttyUSB* with some interval.
But I can not find script or doc for it.
In addition, Is it possible to make connection from MaixPy BIT to PC using micropython?
Thanks in advance!
i have been running the code(on maxipy IDE) as given:
from Maix import I2S
from Maix import Audio
from Maix import FFT
from fpioa_manager import *
import time
fm.register (20, fm.fpioa.I2S0_IN_D0)
fm.register (19, fm.fpioa.I2S0_WS)
fm.register (18, fm.fpioa.I2S0_SCLK)
fm.register (34, fm.fpioa.I2S2_OUT_D1)
fm.register (35, fm.fpioa.I2S2_SCLK)
fm.register (33, fm.fpioa.I2S2_WS)
rx = I2S (I2S.DEVICE_0)
rx.channel_config (rx.CHANNEL_0, rx.RECEIVER, align_mode = I2S.STANDARD_MODE)
rx.set_sample_rate (16000)
tx = I2S (I2S.DEVICE_2)
tx.channel_config (tx.CHANNEL_1, tx.TRANSMITTER, align_mode = I2S.RIGHT_JUSTIFYING_MODE)
tx.set_sample_rate (16000)
while True:
audio = rx.record (256)
audio_data = audio.to_bytes ()
play_audio = Audio (audio_data)
tx.play (play_audio)
i couldnt play and record the sound on my sipeed m1w .
may i know why ?
Please add example scripts for AprilTags. Thank you!
Hi,
I want to use 2 model, ex 1MB vs 3 MB, how can I put it to sipeed and read it
Thanks
A website in this tutorial (http://blog.sipeed.com/p/233.html) is not found,the missing website is at step 6(http://blog.sipeed.com/p/162.html).
人脸跟踪云台教程里第6步的烧录固件的网址失踪了.这个问题有待解决.
教程网址(http://blog.sipeed.com/p/233.html)
无法显示的网址(http://blog.sipeed.com/p/162.html)
人菜心大留.
File "", line 1, in
File "/flash/demo_net_socket.py", line 10, in
AttributeError: type object 'board_info' has no attribute 'WIFI_RX'
Getting the above error.
Running the demo script 'demo_net_socket.py ' I have changed the nic,connect() with my own wifi ssid and password.
Any help here would be appreciated
The documentation is horrible to say the least. I am trying to learn how to get the WIFI working and even though I tried the scripts they do not work.
The demo in 2 at https://maixpy.sipeed.com/zh/libs/Maix/kpu.html, that shows the feature map doesn't work.
The error "kpu: can't convet float fmap yet" occurs, no matter how to modify the index and num. The last layer of the network is anti-quantized, however, as far as I understand, the other layers are quantized, and their feature maps should be displayed, but they are not.
How do I modify this demo to make it work?
The example of SPI is not communication on maixduino.
https://github.com/sipeed/MaixPy_scripts/blob/master/hardware/demo_spi.py
Maixduino communication is follow,
K210-IO | Function | ESP32-IO | Function |
---|---|---|---|
IO25 | SPI_CS | IO5 | SPI_CS |
IO26 | SPI_MISO | IO23 | SPI0_MISO |
IO27 | SPI_SCLK | IO18 | SPI0_SCLK |
IO28 | SPI_MOSI | IO14 | SPI0_MOSI |
IO09 | GPIO | IO25 | ESP32_READY |
IO08 | GPIO | Dedicated pin | ESP32_EN |
fm.register(25,fm.fpioa.SPI1_SS0)#cs
fm.register(28,fm.fpioa.SPI1_D0)#mosi
fm.register(26,fm.fpioa.SPI1_D1)#miso
fm.register(27,fm.fpioa.SPI1_SCLK)#sclk
spi01=SPI(SPI.SPI1,mode=SPI.MODE_MASTER,baudrate=10000000,polarity=0,phase=0,bits=8,firstbit=SPI.MSB,mosi=fm.fpioa.SPI1_D0,miso=fm.fpioa.SPI1_D1,sck=fm.fpioa.SPI1_SCLK,cs0=fm.fpioa.SPI1_SS0)
I burned my model at 0x500000 address, after burned erase _ spiffs.kfpkg and maixpy_ v0.4.0_ 50_ Gcafae9d.bin. Then the code runs to the "kpu.load(0x500000)" the following error was reported. I tried another address (there is no model on the address), and the same error was reported too.
board : Maix Go
GPIO IRQ sample (https://github.com/sipeed/MaixPy_scripts/blob/master/hardware/demo_gpio_intr.py) has a wrong signature for the IRQ handler, at least for MaixPy 5
def test_irq(GPIO, pin_num):
print("key", pin_num)
Gives an error as callback is expected to have one argument only, the GPIO object. Replacing with:
def test_irq(gpio):
print("key", gpio)
works. However, GPIO module doesn't expose a reader for pin number so one has to compare gpio
against the gpio objects. Mabye not ideal in an IRQ handler?
Hi I was wondering an example could be written for the mlx90640 that reads the data via i2c? I see the example of the one that uses the breakout board with the uart but was wondering if one could be written for the i2c for faster reading of the data.
Hi everyone,
i was trying to create a 3d array of data of spectrogram from the FFT module produced by sipeed m1w.
i can create a list of fft amplitude array base on the sample points.
Anyone is doing something similar to my project ? Hope we can share some experience as well.
My MaixCube with firmware V0.5.0-62-gd6620f1 shows a left-right reversed image on the built in screen. Where do I find the source code for the built in apps to correct the problem?
Second last line:
fm.unregister(board_info.LED_R, fm.fpioa.GPIOHS0)
should be green LED - LED_G:
fm.unregister(board_info.LED_G, fm.fpioa.GPIOHS0)
import network
from Maix import GPIO
from fpioa_manager import fm, board_infoWIFI_SSID = ""
WIFI_PASSWD = ""IO map for ESP32 on Maixduino
fm.register(25,fm.fpioa.GPIOHS10)#cs
fm.register(8,fm.fpioa.GPIOHS11)#rst
fm.register(9,fm.fpioa.GPIOHS12)#rdy
fm.register(28,fm.fpioa.GPIOHS13)#mosi
fm.register(26,fm.fpioa.GPIOHS14)#miso
fm.register(27,fm.fpioa.GPIOHS15)#sclknic = network.ESP32_SPI(cs=fm.fpioa.GPIOHS10,rst=fm.fpioa.GPIOHS11,rdy=fm.fpioa.GPIOHS12, mosi=fm.fpioa.GPIOHS13,miso=fm.fpioa.GPIOHS14,sclk=fm.fpioa.GPIOHS15)
nic.connect(WIFI_SSID, WIFI_PASSWD)
print(nic.ifconfig())
print(nic.isconnected())
print("ping baidu.com:", nic.ping("baidu.com"), "ms")
nic.disconnect()
But i am getting OSError: Get version fail
SSID and Password is definitely correct.
Traceback (most recent call last):
File "", line 18, in
OSError: Get version fail
MicroPython v0.5.0-38-g4c4d5b6 on 2020-04-10; Sipeed_M1 with kendryte-k210
Hello,
I'm trying to run the following code :
import sensor
import image
import lcd
import KPU as kpu
lcd.init()
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)
task = kpu.load(0x300000) # you face model in flash at address 0x300000
print("Done")
img = sensor.snapshot()
a = kpu.forward(task, img,1) #<--- this is the problematic line
print("OK")
However, MaixPy IDE return the message "OS ERROR".
What could be the problem? How can I solve it?
Thank you for your help!
trying to run this code
from Maix import GPIO
fm.register(board_info.LED_B, fm.fpioa.GPIO0)
led_r=GPIO(GPIO.GPIO0,GPIO.OUT)
led_r.value(0)
But it am getting this error. Any help will be highly appreciated. Thanks in advance. I am using MaixGo.
Traceback (most recent call last):
File "", line 2, in
NameError: name 'fm' isn't defined
MicroPython v0.5.0-38-g4c4d5b6 on 2020-04-10; Sipeed_M1 with kendryte-k210
I've tried to run below script at my Sipeed MAix Dan Dock(M1w model).
https://github.com/sipeed/MaixPy_scripts/blob/master/network/demo_wifi_ap_scan.py
but got the following error.
Traceback (most recent call last):
File "<stdin>", line 36, in <module>
AttributeError: 'ESP8285' object has no attribute 'scan'
What's wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.