GithubHelp home page GithubHelp logo

smart-van-2-0 / com.robypomper.smartvan.fw.sim7600 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 45 KB

Simple Python module that read data from SIM7600 devices and share them on the local DBus.

Home Page: https://smartvan.johnosproject.org/

License: Other

Python 100.00%
firmware sim7600 smartvan waveshare

com.robypomper.smartvan.fw.sim7600's Introduction

FW SIM 7600

Simple Python module that read data from SIM7600 and share them on the local DBus.
This repository is part of the Smart Van Project.

FW Name: FW SIM7600
FW Group: com.robypomper.smartvan.fw.sim7600
FW Version: 1.0.0

README | CHANGELOG | TODOs | LICENCE

Once ran, this script reads data from the serial specified port then notify the DBus with updated values. The DBus service and his properties depends on the model get from the device (using the AT+CGMM command). More info on Supported devices and value mapping.

Run

This is a Python script, so python is required to run it.

$ python --version
# if not installed, then run
$ sudo apt-get install python3 python3-pip

In addition, some other package must be installed in order to configure python's dependencies like PyGObject or pydbus. If you are using a debian/ubuntu based distribution, then you can run:

$ sudo apt-get install libcairo2-dev libgirepository1.0-dev dbus-x11

Once Python was installed on your machine, you can install the script's requirements globally or create a dedicated venv.

# Init venv (Optional)
$ python -m venv venev
$ source venv/bin/activate

# Install script's requirements
$ pip install -r requirements.txt

Now, you are ready to run the script with the command:

$ python run.py

or alternative options
$ python run.py --quiet
$ python run.py --debug --simulate
$ python run.py  --dbus-name com.custom.bus --dbus-obj-path /custom/path --dbus-iface com.custom.IFace

For script's remote usage please see the dedicated page.

Defaults DBus params are:

  • DBus Name: com.waveshare.sim7600
  • DBus Obj Path: DEV_TYPE_* as device code (eg: SIM7600 become /sim7600, see Supported devices for the full list of DEV_TYPE_* values)
  • DBus Interface: DEV_IFACE_* (eg: com.waveshare.sim7600, see Supported devices for the full list of DEV_IFACE_* values)

Script's arguments

The run.py script accept following arguments:

  • -h, --help: show this help message and exit
  • -v, --version: show version and exit
  • --port PORT: Serial port name (default: /dev/ttyAMA0)
  • --speed SPEED: Serial port speed (default: 115200)
  • --simulate: Simulate a UPS Pack V3 Device (default: False)
  • --dbus-name DBUS_NAME: DBus name to connect to (Default: com.waveshare.sim7600)
  • --dbus-obj-path DBUS_OBJ_PATH: DBus object path to use for object publication (Default: the device_type_code string)
  • --dbus-iface DBUS_IFACE: DBus object's interface (Default: current device's dbus_iface)
  • --dev: enable development mode, increase log messages
  • --debug: Set log level to debug
  • --quiet: Set log level to error and

Develop

The main goal for this script is to link the Device's protocol to the DBus. So, in addition to the main script, all other files are related to the Device or to the DBus protocols.

Module's files can be grouped in 2 categories:

Definitions:

Operations:

com.robypomper.smartvan.fw.sim7600's People

Contributors

robypomper avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.