Connecting nxt ultrasonic sensor with a hitechnic sensor multiplexer does not work
See original GitHub issueev3dev version: 4.14.80-ev3dev-2.3.1-ev3
ev3dev-lang-python version: ii python3-ev3dev 1.2.0 all Python language bindings for ev3d ii python3-ev3dev 2.0.0~beta2 all Python language bindings for ev3d
I am trying to connect a lego nxt ultrasonic sensor to my ev3 through an hitechnic sensor multiplexer. I read that i have to manually set the device with “set_device = “lego-nxt-us””. I am always getting an OSError: [Errno 22] Invalid argument error.
My code:
port = LegoPort(address="in2:i2c8:mux2")
port.mode = 'i2c'
port.set_device = "lego-nxt-us"
us = UltrasonicSensor(address="in2:i2c8:mux")
The error:
line 3, in <module>
port.set_device = "lego-nxt-us"
File "/usr/lib/python3/dist-packages/ev3dev/core.py", line 3077, in set_device
self._set_device = self.set_attr_string(self._set_device, 'set_device', value)
File "/usr/lib/python3/dist-packages/ev3dev/core.py", line 229, in set_attr_string
return self._set_attribute(attribute, name, value)
File "/usr/lib/python3/dist-packages/ev3dev/core.py", line 211, in _set_attribute
attribute.write(value.encode())
OSError: [Errno 22] Invalid argument
I tried everything and need your help now. Thanks in advance.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to use HiTechnic sensor multiplexer in NXT++? ... - Yumpu
And we madeassumption that sensor multiplexer is connected to port IN_1, change if you usedifferent port.(II) Usage for advanced users:Paste ...
Read more >How to use HiTechnic sensor multiplexer in NXT++? ...
sln file, open solution re4.sln from your path, and in re4 properties, particularly in: - configuration properties/C/C++/general Additional Include Directories/.
Read more >Released: NXC driver for HiTechnic Sensor MUX - Bot Bench
I have been running some tests and only have a couple issues thus far: 1) I can't get a standard Lego light sensor...
Read more >Question about Using NXT Sensor Adapter for NI myRIO to ...
We tried putting NXT touch sensor and NXT light sensor and used the ... the problem is regarding the use of the Digilent...
Read more >HiTechnic NXT Force Sensor - Modern Robotics Inc
This sensor can be thought of as an analog touch sensor. Unlike a touch sensor, which gives just a binary value indicating pressed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This mux itself also show up as a sensor. You can use the generic
Sensor
class for this. If I recall, you have to put the mux inRUN
mode before you can read any values. TheDETECT
mode can be a bit temperamental, but it should be able to be used to detect the LEGO NXT Ultrasonic sensor. Also, theUltrasonicSensor
class is probably just for the EV3 Ultrasonic sensor, not the NXT one, so you probably need to use the genericSensor
class for that too.Good thinking to check
dmesg
.-12
meansENOMEM
. Looking at the driver code, it looks like we have a serious mistake. We are forgetting to allocate some memory for the sensor modes.I’ve started https://github.com/ev3dev/ev3dev/issues/1210 to track the issue since this isn’t a python problem. Further comments should be made there.