Giter Club home page Giter Club logo

meshwatch's Introduction

TheDevice

Project: RENAMED

The MeshTalk name is already used, and since this program does so much more I decided now is the time to change the name.

MeshWatch

MeshWatch is a python3 program that will allow you to send and receive messages from python. The messages are decoded and displayed in a text based interface created with Curses.

I built this project with the goal of learning about the Meshtastic API and to get used to using new development tools such as Visual Studio Code and GitHub.

My progress can be followed here: https://datagod.hashnode.dev/series/meshtalk-development

Shameless Plug: https://hashnode.com/@datagod/joinme

Built with Curses

This project uses Curses to draw text windows and pads to keep the different types of information separated. You can use a screen directly connected to the pi or use an SSH session. I have used Kitty in my tests. If you Kitty screen is not large enough you will recieve strange display errors.

Screen Layout

The screen has 5 areas of scrolling text.

Top Row

Top Row

The top row has basic information messages from the system, a debug area that shows the currently executing function, and a spot to show incoming messages.

Decoded Packets

Decoded Packets

Each packet that is intercepted will be displayed here in, decoded. Some fields such as RAW are not supported yet. This type of window is using a wrap around function to display the new lines.

Extended Info

Just the Keys

This is a curses text pad that scrolls upwards as new lines are entered. In this example I am displaying the connected nodes in the mesh.

Help

Help is here!

This is a curses text pad that scrolls upwards as new lines are entered. In this example I am displaying the connected nodes in the mesh.

Send Messages

As per the help instructions, press S to send a message. Press control+g when finished.

Viewing Messages

Messages

As messages are sent or received, they are displayed in the Messages text box.

Installation

Meshtastic Python

Make sure to follow the guide here to install the tools needed to connect to the Meshtastic device using Python. https://meshtastic.org/docs/software/python/python-installation

MeshWatch

Install

GeoPy

We use a function from the GeoPy module to calculate distance between nodes.

https://pypi.org/project/geopy/

pip3 install geopy

Connect to Device

Connect your Raspberry Pi to the Meshtastic device via USB cable. For more information on setting up software to talk to the device, see the following:

Usage

To receive packets and decode them in a fancy text based display, use the following command:

Run

meshwatch's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

meshwatch's Issues

Meshwatch crashes when trying to view nodes

Describe the bug
Crashes when viewing nodes

To Reproduce
Open meshwatch, press N to view nodes

Screenshots

  karl@mini  ~  130  python3 meshtastic/meshwatch/meshwatch.py


--------------------------------------------------------------
ERROR - Function ( Clear ) has encountered an error.
prefresh() returned ERR


TRACE
Traceback (most recent call last):
  File "meshtastic/meshwatch/meshwatch.py", line 431, in Clear
    self.TextPad.refresh(0,0,self.y1,self.x1,self.y1 + self.rows,self.x1 + self.columns)
_curses.error: prefresh() returned ERR



Additonal info: erasing textpad


--------------------------------------------------------------


Good by for now...

Desktop (please complete the following information):
meshtastic version: 1.2.80
meshwatch version: latest:

commit a0f856c (HEAD -> main, origin/main, origin/HEAD)
Author: riddick [email protected]
Date: Tue Dec 28 21:56:15 2021 +0100

Update meshwatch.py

fix for recent meshtastic version, tested with 1.2.46

Receive on a smaller screen

Hi, is it possible to receive on a much smaller screen using just the messages "window" screen?
I'm building a device like beepberry that'll be connected throught USB to meshtastic station G1. The code is working through SSH but the screen size of the device is way to small to show all the info. Preferably I'd like to use just the message feature (receive - decode - print on a screen) and send message.

Handling error messages on the interface

When connection to the device breaks, error messages leak over the interface from the Debug window position (cursor), covering the Messages window and any existing text.

Possible solutions:

  • relocate the prompt to the bottom of the screen before the API call;
  • or contain the error message within the Extended Information window;
  • or relocate de Debug window to the bottom of the screen, in a way that errors don't cover sensitive information.

Example:

Captura de Tela 2021-10-15 às 07 58 25 - cópia

Send Message crashes now that curses are used

Sendmessage crashes now that we are using curses.
Make sure the main function area skips the curses section when sending a message from the command line. Simply send, report, exit.

Show Logs Error

Pressing 'L' to Show Logs gives an error in the Extended Information window:
Could not open /var/log/kern.log.

Mac OS 14.2.1

No run with upgrade of Meshtastic 1.3

No run with upgrade of Meshtastic from 1.2 to 1.3

Always was run very well with my TTGO with firmware Meshtastic 1.2. I put firmware 1.3 ...

Nothing run.

ERROR - Function ( main ) has encountered an error.
Timed out waiting for connection completion

TRACE
Traceback (most recent call last):
File "/home/admin/meshtalk/meshwatch.py", line 1621, in main
interface = meshtastic.serial_interface.SerialInterface()
File "/usr/local/lib/python3.9/dist-packages/meshtastic/serial_interface.py", line 55, in init
StreamInterface.init(self, debugOut=debugOut, noProto=noProto, connectNow=connectNow)
File "/usr/local/lib/python3.9/dist-packages/meshtastic/stream_interface.py", line 48, in init
self.connect()
File "/usr/local/lib/python3.9/dist-packages/meshtastic/stream_interface.py", line 72, in connect
self._waitConnected()
File "/usr/local/lib/python3.9/dist-packages/meshtastic/mesh_interface.py", line 401, in _waitConnected
raise Exception("Timed out waiting for connection completion")
Exception: Timed out waiting for connection completion

Additonal info: Main function


Good by for now...
1

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Device Info - Status

Status indicator has stopped functioning. Make sure it is updated when the device responds to requests or receives packets.

Resizing terminal window causes error

Describe the bug

Users reported that while running in a terminal window N and I functions result in error:

ERROR - Function ( Clear ) has encountered an error.
prefresh() returned ERR

TRACE
Traceback (most recent call last):
File "./meshwatch.py", line 430, in Clear
self.TextPad.refresh(0,0,self.y1,self.x1,self.y1 + self.rows,self.x1 + self.columns)
_curses.error: prefresh() returned ERR

Additonal info: erasing textpad

Note from another user regarding curses:
ksamson
2d
For those having stability issues, I happened to trip over this:
curses — Terminal handling for character-cell displays — Python 3.10.0 documentation 2
A bug in ncurses, the backend for this Python module, can cause SegFaults when resizing windows. This is fixed in ncurses-6.1-20190511. If you are stuck with an earlier ncurses, you can avoid triggering this if you do not call addstr() with a str that has embedded newlines. Instead, call addstr() separately for each line.

Adding TCP/IP interface

Would be great to connect via TCP/IP interface over WiFi, besides Serial.

Seems to work replacing code line 1482: interface = meshtastic.SerialInterface()
with: interface = meshtastic.TCPInterface("192.168.1.X")

Hope it is a good start for others interested in doing the same.

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.