I'm looking to use Minimal Modbus to connect to my Solar Invertor (GivEnergy) via an RS485-USB adaptor. Unfortunately the implementation of the Modbus Protocol has reversed the CRC bytes, so Minimal Modbus fails on the CRC check. Is there a way of reversing the CRC bytes in the call, perhaps with an option flag, or can I manually build the CRC and inject my own?
Python Minimal Modbus CRC byte order
661 Views Asked by Britkat1980 At
1
There are 1 best solutions below
Related Questions in PYTHON
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
- python how to write list of lists to file
- Removing URL features from tokens in NLTK
- Optimizing for Social Leaderboards
- Python : Get size of string in bytes
- What is the code of the sorted function?
Related Questions in MODBUS
- Jamod Slave Example, can not connect to slave
- Jamod Modbus Slave - assign registers
- Pymodbus Read/Write Floats (REAL)
- Redis and memory
- Could not find the ttyUSB0 port on my Ubuntu Box saying NoSuchPortException
- What is fullform of RTU in modbusRTU?
- Get pymodbus to read registers from multiple clients asynchronously
- writing a modbus program for a Open-WRT router using libmodbus C (rewrite Python app to C)
- Sending numerous packets instead of 1 SSL Python
- Pymodbus/Twisted Asynchronous Client Reconnecting
- PLC Simulator for communication
- Optimizing C# Tcp stream code
- Illegal data address exception in j2mod
- nmodbus - Message frame must contain at least 6 bytes of data
- Undefined symbols for architecture x86_64 in Xcode 8.3.3 for iOS app
Related Questions in MINIMALMODBUS
- Can't connect to EPsolar Tracer 3210an charge controller from Windows 10 via Serial / Modbus
- Modbus Checksum Error using minimalmodbus python library with Waveshare RS485 CAN HAT (B) on Raspberry Pi 3B+
- minimalmodbus.NoResponseError: No communication with the instrument (no answer)
- Minimalmodbus - RS485 shield for Raspberry Pi
- minimalmodbus : Wrong Message being sent over Serial
- How to read serial port with several scripts?
- Minimalmodbus I can read data, but i cannot write it (RTU)
- Store modbus messages using minimalModbus
- Python Minimal Modbus CRC byte order
- Looking for an error in my Modbus Console.WriteLine
- pyserial/Modbus - troubleshooting "No communication with instrument"
- snmpd pass to run python
- Noob trying to get values from his EnergyMeter via Modbus RTU RS485 in python
- Trouble reading MODBUS register using Python
- How to read slave modbus holding registers by pymodbus?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You don't need to inject your own CRC, that would be more difficult than in fact is to solve your problem (you are free to do it if you want of course).
Just change this line in your minimalmodbus.py:
to:
You can find the location of the file running this command:
python -m siteand looking for thesite-packagesfolder.On most Linux distros with Python 3.x the folder is:
'/home/your_user_name/.local/lib/python3.x/site-packages'If you are asking why should you be messing with the code, you are not alone. While I was musing that very same question myself (after writing this answer I swear) I found this issue.
I guess the short answer is: you should be complaining to the developers of your device.
For completeness: if you don't want to edit minimalmodbus.py as the answer to the issue recommends you should just overload the whole
_calculate_crc_string(inputstring)function changing the last line as I wrote above.For total completeness, I'm adding the code on the link above here. To overload the function just write all its code again in your Python script right after you import minimalmodbus:
Note the last line outside of the function to overload the
_calculate_crc_string. After that, you can add the rest of your code.