Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - no attribute 'flushoutput' #427

Open
remintz-acn opened this issue Jun 19, 2019 · 3 comments · May be fixed by #624
Open

Error - no attribute 'flushoutput' #427

remintz-acn opened this issue Jun 19, 2019 · 3 comments · May be fixed by #624

Comments

@remintz-acn
Copy link

When running

$ rosrun rosserial_python serial_node.py tcp

and the device (NodeMCU) is reset

I get the following

[ERROR] [1560968878.473622]: Lost sync with device, restarting...
[INFO] [1560968878.475121]: Requesting topics...
[WARN] [1560968878.498287]: Last read step: data checksum
[WARN] [1560968878.499542]: Run loop error: [Errno 104] Connection reset by peer
[INFO] [1560968878.510628]: Removing subscriber: /hero_0/cmd_vel
[INFO] [1560968878.512802]: Removing subscriber: /hero_0/motor
[INFO] [1560968878.514852]: Shutting down
[INFO] [1560968878.515763]: All done
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/rosserial_python/serial_node.py", line 73, in <module>
    server.listen()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosserial_python/SerialClient.py", line 253, in listen
    self.startSerialClient()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosserial_python/SerialClient.py", line 259, in startSerialClient
    client.run()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosserial_python/SerialClient.py", line 556, in run
    self.port.flushOutput()
AttributeError: RosSerialServer instance has no attribute 'flushOutput'

remintz added a commit to remintz/rosserial that referenced this issue Jun 19, 2019
@Saums
Copy link

Saums commented Sep 16, 2019

I'm receiving the same error. Did you find a solution?

mnbf9rca added a commit to mnbf9rca/simple_robot_arm_with_ros that referenced this issue Oct 15, 2019
@Koraze
Copy link

Koraze commented Nov 11, 2019

I work on ROS Melodic on Raspberry Pi 4 with Raspbian Buster.

I also got the same issue, so I remove code around line 556 in SerialClient.py

with self.write_lock:
     self.port.flushOutput()

It's seems to work now ... I hope those lines weren't so important ...

@mbilsky
Copy link

mbilsky commented Apr 29, 2020

On line 281 flushInput() is defined, so I pasted a similar definition right below:

def flushInput(self):
    pass

def flushOutput(self):
    pass

I initially thought it may be because flushInput/flushOutput are depreciated from pyserial (now called reset_output_buffer() ): https://pythonhosted.org/pyserial/pyserial_api.html#serial.Serial.reset_output_buffer

I'm running pyserial 3.4. This change didn't help so I just created the blank definition above and it seems to work robustly enough.

cole-kenny added a commit to CU-Hyperloop/rosserial that referenced this issue Aug 19, 2022
flushInput/Output are maybe depreciated, but adding the flushOutput definition seems to be required. Source here: ros-drivers#427
rezeck added a commit to rezeck/rosserial that referenced this issue Aug 11, 2023
@peci1 peci1 linked a pull request Nov 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants