Skip to main content
rcservo logo

SerialTalk: platform-independent symmetric communication library

This package facilitates communication between devices like Robots and peripheral embedded systems or monitors over a serial communication line. Sounds abstract? Think of connecting an OpenMV camera to a LEGO SPIKE Prime Robot. Or linking up two Pyboards.

PyPI version License: MIT MicroPython Compatible

Installation

For Python (PyPI)

Install from PyPI using pip:

pip install serialtalk

For MicroPython

  1. Go to viperIDE.org
  2. Connect to your MicroPython device
  3. Navigate to Tools > Package Manager
  4. Click Install package via link
  5. Enter: github:antonvh/SerialTalk

Option 2: Using mpremote

mpremote mip install github:antonvh/SerialTalk

Option 3: Using mip from device REPL

import mip
mip.install("github:antonvh/SerialTalk")

Usage

When you want default UART for the platform you're running on, just go: from serialtalk.auto import SerialTalk

When you want special channels like sockets or bluetooth, do it like this:

from serialtalk import SerialTalk
from serialtalk.sockets import ClientSocketSerial

ser = SerialTalk(ClientSocketSerial("127.0.0.1",8080))
ser.call('echo','read?')

Example with OpenMV H7

  1. Copy the complete serialtalk directory to the OpenMV flash (not the whole SerialTalk, just the serialtalk subfolder)

  2. Create a main.py with this code. It is an adaptation of the OpenMV Hello world

    import sensor, image, time
    from serialtalk.auto import SerialTalk
    
    sensor.reset()                      # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QVGA)   # Set frame size to QVGA (320x240)
    sensor.skip_frames(time = 2000)     # Wait for settings take effect.
    clock = time.clock()                # Create a clock object to track the FPS.
    
    st = SerialTalk()                   # Create UART comm object
    def fps():                          # Create function to call from uart
        return clock.fps()
    st.add_command(fps,"repr")          # Add function to callable uart commands
    
    while(True):
        clock.tick()                    # Update the FPS clock.
        img = sensor.snapshot()         # Take a picture and return the image.
        st.process_uart()               # Process aurt calls
        print(clock.fps())              # Note: OpenMV Cam runs about half as fast when connected
                                        # to the IDE. The FPS should increase once disconnected.
    
  3. On the SPIKE Prime Install mpy-robot-tools with the installer script. Note that the installer may seem unresponsive. Just have some patience.

  4. Run this script on SPIKE Prime:

    from projects.mpy_robot_tools.serialtalk import SerialTalk
    from projects.mpy_robot_tools.mshub import MSHubSerial
    
    st = SerialTalk(MSHubSerial('F'))
    
    print(st.call('echo','Hello there OpenMV!'))
    print(st.call('fps'))
    

This should be the result:

Spike result

Roadmap, todo

  • test on esp8266 platform
  • test on bt comm channels
  • create pyserial/desktop channels

Metadata

Release files for serialtalk 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serialtalk 1.0.0
File Size Uploaded Provenance Actions
serialtalk-1.0.0.tar.gz 614.9 kB Without provenance Details for serialtalk-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for serialtalk 1.0.0
File Interpreter ABI Platform Actions
serialtalk-1.0.0-py3-none-any.whl Python 3 none any Details for serialtalk-1.0.0-py3-none-any.whl

Total release size: 630.9 kB

Release files / serialtalk-1.0.0.tar.gz

Download URL serialtalk-1.0.0.tar.gz
Size 614.9 kB
Tags Source
SHA-256 checksum
How to use checksums
07b574ca460ab69a10980cc53274378a3a9164a3d1fa08aea7c5a2274cee511c
BLAKE2b-256 checksum
How to use checksums
6bdebd098f282ccef771660e626b24b866f473b942b73a5c15d492e2c725dfdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / serialtalk-1.0.0-py3-none-any.whl

Download URL serialtalk-1.0.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
657621f4fe488bc32e2ecf3aeca8d00408ced10a689af85ccd6337deab23dce7
BLAKE2b-256 checksum
How to use checksums
500c72114b8eb1cd397c64ded998a590a9cf88eea60e2d82fb8df6849802d1d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for serialtalk 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page