Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agentcube-python

Python SDK for AgentCube — HTTP admin API + ACSP frame/video stream.

Part of CubeFW.

Install

pip install -e /path/to/agentcube-python
# ffmpeg required for video:
brew install ffmpeg

Play video

from agentcube import Cube, play_video

cube = Cube("192.168.1.97")
cube.play_video("clip.mp4", fps=10)

# or module-level helper
play_video("192.168.1.97", "clip.mp4", fps=12, loop=True)

CLI example:

python examples/play_video.py -H 192.168.1.97 -i clip.mp4 --fps 10

Frames are 80×80 RGB565 over TCP :81; firmware keeps the previous image until the full frame is received, then SPI-scales to 240×240.

Other

cube = Cube("192.168.1.97")
print(cube.ping())           # stream_info / wifi
print(cube.stream_info())
cube.draw_clear("#001122")
cube.draw_text("hello", x=20, y=100, color="#00FF88", size=2)

# raw frames
from agentcube import AcspClient
with AcspClient("192.168.1.97") as s:
    s.send_frame(rgb565_bytes)  # len == 80*80*2

Layout

agentcube/
  __init__.py
  cube.py       # Cube client
  acsp.py       # ACSP TCP protocol
  video.py      # play_video() via ffmpeg
examples/
  play_video.py
tests/

Related

License

MIT

About

Python SDK for AgentCube — apps that talk to the cube firmware.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages