Comments (8)
I am having the same problem on MacOS.
./manual_tests/test_blynkV2.py::BlynkPublisherTest::test_pushvalue Failed with Error: 'socket' object has no attribute 'write'
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
yield
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 615, in run
testMethod()
File "/Users/jeff/GitHub/wiab/tests/manual_tests/test_blynkV2.py", line 28, in test_pushvalue
blynk = BlynkLib.Blynk(BLYNK_AUTH_TOKEN, insecure=True)
File "/Users/jeff/GitHub/wiab/.env/lib/python3.7/site-packages/BlynkLib.py", line 214, in init
BlynkProtocol.init(self, auth, **kwargs)
File "/Users/jeff/GitHub/wiab/.env/lib/python3.7/site-packages/BlynkLib.py", line 81, in init
self.connect()
File "/Users/jeff/GitHub/wiab/.env/lib/python3.7/site-packages/BlynkLib.py", line 245, in connect
BlynkProtocol.connect(self)
File "/Users/jeff/GitHub/wiab/.env/lib/python3.7/site-packages/BlynkLib.py", line 125, in connect
self._send(MSG_HW_LOGIN, self.auth)
File "/Users/jeff/GitHub/wiab/.env/lib/python3.7/site-packages/BlynkLib.py", line 117, in _send
self._write(msg)
File "/Users/jeff/GitHub/wiab/.env/lib/python3.7/site-packages/BlynkLib.py", line 249, in _write
self.conn.write(data)
AttributeError: 'socket' object has no attribute 'write'
from blynk-library-python.
@Judas2016 It's not OS related but library. It appears to be a timing problem between the client and server.
from blynk-library-python.
Did you have any luck in getting it to work with SSL?
from blynk-library-python.
Only with ESP not with Raspberry
from blynk-library-python.
I got SSL working on macOS and the library works as expected now. I updated the version of Python to latest 3.9 from 3.7 and solved the problem.
from blynk-library-python.
Im noticing the same issue with my RPI disconnecting.
It looks like when the socket tries to read here (and there's no data) you get a timeout so this line doesn't get called for a while. Then when it eventually does get called depending on how long its been these lines get called and it disconnects.
Not sure if this is a bug in the code or if the conn.read is expecting the blynk server to send data/heartbeat. I honestly just removed those two lines (136-137) and my RPI stoped disconnecting and the project has been working.
If this is a bug in the code than I'm sure there is a more elegant way to fix this
from blynk-library-python.
@jonathongardner Interesting! Which server are you using? The central or the assigned one? In my case, the connection works better with the assigned one being it lon1 or fran1.
from blynk-library-python.
Yeah I'm just using the default one in the package
from blynk-library-python.
Related Issues (20)
- Invalid Auth Token
- Invalid auth token with both py libraries for Blynk console 2.0 HOT 3
- Pycom Lopy4 disconnects HOT 4
- Invalid Token RPi4b HOT 8
- Notify HOT 2
- Socket Disconnects - Blynk offline HOT 4
- pip install blynk-library-python doesn't pull 1.0.0 HOT 5
- How to use Blynk.Inject with ESP32? HOT 6
- Does not recover after disconnect
- An Example might be wrong when I demo it on ubuntu. @blynk.on => @blynk.ON
- BrokenPipeError HOT 6
- Connection doesn't work, requires server="blynk.cloud" HOT 1
- Pin Handlers
- Install BlynkLib using mip.install HOT 1
- AttributeError: module 'os' has no attribute 'uname'. Did you mean: 'name'? HOT 3
- 'Blynk' object has no attribute 'VIRTUAL_WRITE' on a raspberry pi pico w HOT 3
- Unable to sync manual switch with the blynk app button
- Connecting to blynk.cloud:443... HOT 1
- #corrected funnction for blynk connection issue with the blynklib.py file it has issue in connect self function HOT 1
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 blynk-library-python.