Git Product home page Git Product logo

Comments (8)

Judas2016 avatar Judas2016 commented on July 16, 2024

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.

ebolisa avatar ebolisa commented on July 16, 2024

@Judas2016 It's not OS related but library. It appears to be a timing problem between the client and server.

from blynk-library-python.

Judas2016 avatar Judas2016 commented on July 16, 2024

Did you have any luck in getting it to work with SSL?

from blynk-library-python.

ebolisa avatar ebolisa commented on July 16, 2024

Only with ESP not with Raspberry

from blynk-library-python.

Judas2016 avatar Judas2016 commented on July 16, 2024

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.

jonathongardner avatar jonathongardner commented on July 16, 2024

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.

ebolisa avatar ebolisa commented on July 16, 2024

@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.

jonathongardner avatar jonathongardner commented on July 16, 2024

Yeah I'm just using the default one in the package

from blynk-library-python.

Related Issues (20)

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.