GithubHelp home page GithubHelp logo

pymodbus-dev / modbus-simulator Goto Github PK

View Code? Open in Web Editor NEW
153.0 153.0 54.0 29.57 MB

Modbus simulator based on modbus-tk and kivy

License: Apache License 2.0

Python 99.72% Shell 0.28%
kivy modbus modbus-simulator modbus-tk pymodbus

modbus-simulator'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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modbus-simulator's Issues

Kivy window_sdl2 fails: "Unable to get a Window"

Hi!
I am trying to get this project to work, but dependencies are pretty old and it's not that easy.

I am currently running Python 2.7.14, with these packages:

certifi==2021.10.8
chardet==4.0.0
Click==7.0
Cython==0.29.23
docutils==0.13.1
idna==2.10
Kivy==1.10.1
kivy-deps.glew==0.1.12
kivy-deps.gstreamer==0.1.17
kivy-deps.sdl2==0.1.22
Kivy-Garden==0.1.4
kivy.deps.angle==0.1.6
modbus-tk==1.1.2
Pillow==6.2.2
pygame==1.9.4
pyglet==1.2.4
Pygments==2.1.3
pymodbus==1.5.2
pypiwin32==223
pysdl2-dll==2.24.1
pyserial==3.2.1
pywin32==228
requests==2.12.4
six==1.11.0
urllib3==1.26.12

Now, with this python version I was able to get Kivy 1.10.1, which is needed because the project uses some functions deprecated in newest Kivy versions. But now I have a problem when I try to execute the script:

$ ./tools/launcher
./tools/launcher
[INFO   ] [Logger      ] Record log in C:\Users\PCUT3\.kivy\logs\kivy_22-10-11_8.txt
[INFO   ] [Kivy        ] v1.10.1
[INFO   ] [Python      ] v2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: pil(['text_sdl2'] ignored)
[CRITICAL] [Window      ] Unable to find any valuable Window provider.
sdl2 - ImportError: DLL load failed: Impossibile trovare il modulo specificato.
  File "C:\Python27\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)
  File "C:\Python27\lib\site-packages\kivy\core\window\window_sdl2.py", line 26, in <module>
    from kivy.core.window._window_sdl2 import _WindowSDL2Storage

[CRITICAL] [App         ] Unable to get a Window, abort.

Anyone can help? Any similar issue found online does not have a solution that fixes this.
Thank you very much!

kivy installation error

Hi,

Would you be able to help with this: An error I received while instaling Kivy through 'pip install kivy'

cythoning /tmp/pip-build-7XVqlk/kivy/kivy/_event.pyx to /tmp/pip-build-7XVqlk/kivy/kivy/_event.c
building 'kivy._event' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/tmp
creating build/temp.linux-x86_64-2.7/tmp/pip-build-7XVqlk
creating build/temp.linux-x86_64-2.7/tmp/pip-build-7XVqlk/kivy
creating build/temp.linux-x86_64-2.7/tmp/pip-build-7XVqlk/kivy/kivy
cc -O2 -fPIC -Wimplicit -I/tmp/pip-build-7XVqlk/kivy/kivy/include -I/usr/lib/pypy/include -c /tmp/pip-build-7XVqlk/kivy/kivy/_event.c -o build/temp.linux-x86_64-2.7/tmp/pip-build-7XVqlk/kivy/kivy/_event.o
/tmp/pip-build-7XVqlk/kivy/kivy/_event.c:4:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'cc' failed with exit status 1

unable to get the simulator to work

Hello,

I have tried to get this running on a Rpi3, but fail... I have already fixed a lot of issues, but not sure how to approach this.
I get some wornings, but don't see how to fix this.

pi@ProTracDemo01:~/modbus-simulator $ ./tools/launcher
./tools/launcher
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_21-02-04_6.txt
[INFO ] [Kivy ] v1.10.1
[INFO ] [Python ] v2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0]
[INFO ] [Factory ] 194 symbols loaded
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
[INFO ] [Image ] Providers: img_tex, img_dds, img_pygame, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: pygame
[INFO ] [Window ] Provider: egl_rpi
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <OpenGL ES 2.0>
[INFO ] [GL ] OpenGL vendor
[INFO ] [GL ] OpenGL renderer
[INFO ] [GL ] OpenGL parsed version: 2, 0
[INFO ] [GL ] Shading version <OpenGL ES GLSL ES 1.00>
[INFO ] [GL ] Texture max size <2048>
[INFO ] [GL ] Texture max units <8>
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Clipboard ] Provider: xsel(['clipboard_xclip'] ignored)
[INFO ] [CutBuffer ] cut buffer support enabled
[WARNING] Call to deprecated function init in /usr/local/lib/python2.7/dist-packages/kivy/uix/listview.py line 845.Called from /usr/local/lib/python2.7/dist-packages/kivy/lang/builder.py line 582 by _apply_rule().
[WARNING] Call to deprecated function init in /usr/local/lib/python2.7/dist-packages/kivy/adapters/simplelistadapter.py line 49.Called from /usr/local/lib/python2.7/dist-packages/kivy/uix/listview.py line 859 by init().
[WARNING] Call to deprecated function init in /usr/local/lib/python2.7/dist-packages/kivy/adapters/adapter.py line 111.Called from /usr/local/lib/python2.7/dist-packages/kivy/adapters/simplelistadapter.py line 55 by init().
[WARNING] Call to deprecated function init in /usr/local/lib/python2.7/dist-packages/kivy/uix/abstractview.py line 42.Called from /usr/local/lib/python2.7/dist-packages/kivy/uix/listview.py line 865 by init().
[WARNING] Call to deprecated function init in /usr/local/lib/python2.7/dist-packages/kivy/adapters/dictadapter.py line 59.Called from /home/pi/modbus-simulator/modbus_simulator/ui/datamodel.py line 235 by init().
[WARNING] Call to deprecated function init in /usr/local/lib/python2.7/dist-packages/kivy/adapters/listadapter.py line 185.Called from /usr/local/lib/python2.7/dist-packages/kivy/adapters/dictadapter.py line 67 by init().
[WARNING] Call to deprecated function init in /usr/local/lib/python2.7/dist-packages/kivy/adapters/adapter.py line 111.Called from /usr/local/lib/python2.7/dist-packages/kivy/adapters/listadapter.py line 186 by init().
[WARNING] Call to deprecated function init in /usr/local/lib/python2.7/dist-packages/kivy/uix/listview.py line 845.Called from /home/pi/modbus-simulator/modbus_simulator/ui/datamodel.py line 239 by init().
[INFO ] [GL ] NPOT texture support is available
[WARNING] Call to deprecated function init in /usr/local/lib/python2.7/dist-packages/kivy/adapters/listadapter.py line 185.Called from /home/pi/modbus-simulator/modbus_simulator/templates/modbussimu.kv line 213 by ().
[INFO ] [ProbeSysfs ] device match: /dev/input/event3
[INFO ] [HIDInput ] Read event from </dev/input/event3>
[INFO ] [ProbeSysfs ] device match: /dev/input/event1
[INFO ] [HIDInput ] Read event from </dev/input/event1>
[INFO ] [ProbeSysfs ] device match: /dev/input/event2
[INFO ] [HIDInput ] Read event from </dev/input/event2>
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [Base ] Start application main loop

Thanks,

Patrick

Crash when attempting to add holding registers or input registers

  • OSX 10.14.1
  • Python 3.7
  • pip list

Package Version


Click 7.0
Cython 0.29.2
docutils 0.13.1
Kivy 1.10.1
Kivy-Garden 0.1.4
pip 18.1
pygame 1.9.4
pyglet 1.2.4
Pygments 2.1.3
pymodbus 2.1.0
pyserial 3.4
requests 2.12.4
setuptools 39.0.1
six 1.11.0

Clicking the add button for adding input registers or holding registers crashes the app with the following trace.

[INFO ] [Base ] Leaving application in progress... Traceback (most recent call last): File "/Users/matt/code/modbus-simulator/modbus_simulator/main.py", line 27, in <module> _run() File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/Users/matt/code/modbus-simulator/modbus_simulator/main.py", line 23, in _run run() File "/Users/matt/code/modbus-simulator/modbus_simulator/ui/gui.py", line 1219, in run ModbusSimuApp().run() File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/kivy/app.py", line 826, in run runTouchApp() File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/kivy/base.py", line 502, in runTouchApp EventLoop.window.mainloop() File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/kivy/core/window/window_sdl2.py", line 727, in mainloop self._mainloop() File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/kivy/core/window/window_sdl2.py", line 460, in _mainloop EventLoop.idle() File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/kivy/base.py", line 340, in idle self.dispatch_input() File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/kivy/base.py", line 325, in dispatch_input post_dispatch_input(*pop(0)) File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/kivy/base.py", line 291, in post_dispatch_input wid.dispatch('on_touch_up', me) File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/kivy/uix/behaviors/button.py", line 179, in on_touch_up self.dispatch('on_release') File "kivy/_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch File "kivy/_event.pyx", line 1098, in kivy._event.EventObservers._dispatch File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/kivy/lang/builder.py", line 64, in custom_callback exec(__kvlang__.co_value, idmap) File "/Users/matt/code/modbus-simulator/modbus_simulator/templates/modbussimu.kv", line 256, in <module> on_release: root.update_data_models(*args) File "/Users/matt/code/modbus-simulator/modbus_simulator/ui/gui.py", line 536, in update_data_models self._update_data_models(active, tab, value) File "/Users/matt/code/modbus-simulator/modbus_simulator/ui/gui.py", line 565, in _update_data_models self.update_backend(int(active), current_tab, list_data) File "/Users/matt/code/modbus-simulator/modbus_simulator/ui/gui.py", line 695, in update_backend v['formatter'] File "/Users/matt/code/modbus-simulator/modbus_simulator/utils/pymodbus_server.py", line 268, in encode getattr(builder, add_method)(value) File "/Users/matt/code/modbus-simulator/venv/lib/python3.7/site-packages/pymodbus/payload.py", line 177, in add_16bit_uint self._payload.append(pack(fstring, value)) struct.error: required argument is not an integer

OSX 10.14.1 Python 3.7 Current documentation for pip dependencies results in install error

Installing the pip packages using the README.md versions resulted in several errors.

Cython needed to be upgraded to latest, 0.25.2 resulted in the following install error.

... 
  File "/private/var/folders/cb/7v3cl7jd4hg0c48d38cn6t340000gn/T/pip-install-l . 
ldtnn2n/Cython/Cython/Compiler/Visitor.py", line 15, in <module>
    from . import ExprNodes
  File "/private/var/folders/cb/7v3cl7jd4hg0c48d38cn6t340000gn/T/pip-install- 
lldtnn2n/Cython/Cython/Compiler/ExprNodes.py", line 2813
    
await = None
          ^
SyntaxError: invalid syntax`

And pygame needed to be updated to 1.9.4 because 1.9.2 resulted in this error

WARNING, No "Setup" File Exists, Running "config.py"
Using Darwin configuration...

/bin/sh: sdl-config: command not found
/bin/sh: sdl-config: command not found
/bin/sh: sdl-config: command not found
/bin/sh: freetype-config: command not found
/bin/sh: freetype-config: command not found
/bin/sh: freetype-config: command not found
WARNING: "sdl-config" failed!
WARNING: "freetype-config" failed!
Hunting dependencies...
SDL     : not found
Framework SDL not found
FONT    : not found
Framework SDL_ttf not found
IMAGE   : not found
Framework SDL_image not found
MIXER   : not found
Framework SDL_mixer not found
Framework CoreMIDI found
Framework QuickTime found
PNG     : not found
JPEG    : not found
PORTMIDI: not found
FREETYPE: not found

If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.


Continuing With "setup.py"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/cb/7v3cl7jd4hg0c48d38cn6t340000gn/T/pip-install-es348b7z/pygame/setup.py", line 294, in <module>
    write_version_module(METADATA['version'], revision)
  File "/private/var/folders/cb/7v3cl7jd4hg0c48d38cn6t340000gn/T/pip-install-es348b7z/pygame/setup.py", line 286, in write_version_module
    with open('version.py.in', 'r') as header_file:
FileNotFoundError: [Errno 2] No such file or directory: 'version.py.in'`

Installation fails due to conflicting six version

Hi, users are unable to run modbus-simulator due to dependency conflict with six package.
As shown in the following full dependency graph of modbus-simulator, modbus-simulator requires six==1.10.0,while pymodbus==2.1.0 requires six==1.11.0.

According to pip’s “first found wins” installation strategy, six==1.10.0 is the actually installed version. However, six==1.10.0 does not satisfy six==1.11.0.

Dependency tree

modbus-simulator-1.0.0
| +-click(version range:==7.0)
| +-cython(version range:==0.29.2)
| +-docutils(version range:==0.13.1)
| +-kivy(version range:==1.10.1)
| +-kivy-garden(version range:==0.1.4)
| +-pygame(version range:==1.9.4)
| +-pyglet(version range:==1.2.4)
| +-pygments(version range:==2.1.3)
| | +-coverage(version range:*)
| | +-nose(version range:*)
| | +-pyflakes(version range:*)
| | +-pylint(version range:*)
| | +-tox(version range:*)
| +-pymodbus(version range:==2.1.0)
| | +-six(version range:==1.11.0)
| +-pyserial(version range:==3.2.1)
| +-requests(version range:==2.12.4)
| +-six(version range:==1.10.0)

Thanks for your help.
Best,
Neolith

Where is slave configuration saved?

In some cases the application crashes (when I'm sure how, I'll report it as another bug)

After I restart it, it has the old slaves in the list, however, it keeps throwing the "Slave x does not exist" error on the console. I'm not able to use the slave and I'm not able delete it. The application freezes when I click delete slave.

Where is the slave configuration saved, so that I can go an delete the file, reset the application?

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.