Comments (8)
Basically the buffer wraps. I clear the buffer each time I check, but it could still overlap when a bunch of messages are coming in, like after a group command. The last byte in the buffer indicates the last place it wrote, so everything after the location it points to can be ignored (it was from a prior write).
I guess something in this code isn't working but I'm not sure what. Are you using the latest hub 2245? Do you see anything in your log regarding this? If you have these three lines it would be helpful:
self.logger.info('getBufferStatus: Got raw text of: {}'.format(raw_text))
self.logger.info('bufferEnd hex {} dec {}'.format(buffer_end, buffer_end_int))
self.logger.info('getBufferStatus: non wrapped {}'.format(raw_text))
from insteonlocal.
I'll grab that when I go home. I've got a 2012 hub at home, so maybe the buffer looks a little different?
from insteonlocal.
I know the 2015 has a buffer twice the size of the 2012 one. I don't think the 2015 does zero-padding either. I think they both handle the last byte the same, but I am not positive.
from insteonlocal.
It looks like maybe the 2012 hub doesn't write the last byte with the last location written. I can confirm when I get the raw log from you. If this is the case I may be able to just treat the 2012 hub differently by looking at the total size of the buffer (which should be 100 chars vs the 2015's hub 200+2)
from insteonlocal.
Yeah, the last byte was 00 every time I checked, so that's why I was ending up with an empty string. I'll give you some examples as soon as I get home if it helps
from insteonlocal.
Here's the output
INFO:insteonlocal.Hub:getBufferStatus: http://192.168.0.2:25105/buffstatus.xml
INFO:insteonlocal.Hub:getDirectCommand: http://192.168.0.2:25105/buffstatus.xml
INFO:insteonlocal.Hub:getBufferStatus: Got raw text of: 026230D9270F190006025030D9272CAEA32F02FE000000000000000000000000000000000000000000000000000000000000
INFO:insteonlocal.Hub:bufferEnd hex 00 dec 0
INFO:insteonlocal.Hub:getBufferStatus: non wrapped
INFO:insteonlocal.Hub:postDirectCommand: http://192.168.0.2:25105/1?XB=M=1
INFO:insteonlocal.Hub:clearBuffer: <Response [200]>
INFO:insteonlocal.Hub:
Dimmer 30D927 status: None
INFO:insteonlocal.Hub:
getDeviceStatus for device 30DA8A
INFO:insteonlocal.Hub:directCommand: Device: 30DA8A Command: 19 Command 2: 00 MsgType: Standard
INFO:insteonlocal.Hub:postDirectCommand: http://192.168.0.2:25105/3?026230DA8A0F1900=I=3
OrderedDict([('error', False),
('success', True),
('message', ''),
('msgs', [])])
from insteonlocal.
So, this seems to be working if I make the following changes:
master...wardcraigj:hass-changes
from insteonlocal.
Pull down 0.33... I just changed it to work with your hub..it will only check for the last byte if the buffer size is 202. Could run into issues with your buffer overwriting/overlapping since I wouldn't be able to detect it. Anyways see if that helps. I didn't change the deviceId check as it may resolve itself with the above change. But if not, we can troubleshoot that
from insteonlocal.
Related Issues (12)
- No links in pypi HOT 60
- Can't discover devices via Home Assistant HOT 3
- Typo causing logging to fail. HOT 3
- Dimmers flicker HOT 1
- Cache not being used
- Insteonlocal ownership HOT 1
- Max Listeners HOT 1
- MaxListnersExceededWarning
- Security issue in insteonlocal latest versions - Possible Supply Chain Attack HOT 1
- Add HTTP status code check
- Clean up how the lib is checking for statuses HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from insteonlocal.