Page 1 of 1

Help establishing a connection BotVac 85 serial with raspi

PostPosted: July 9th, 2019, 9:29 am
by MadAEng
Hi all,

I'm currently working on a project to integrate a pi zero W in my neato Botvac.
Connecting it by way of a USB cable was pretty straightforward, tried that out according to this method: https://www.instructables.com/id/How-to-Control-a-Neato-Robot-From-a-Raspberry-Pi/

However, since I want to be able to use it differently then in that thread, the USB port was not an option as that didn't fit with the dust bin in.
So, I decided to use the RS232 port on the BotVac board instead, connecting the pi's UART port with a MAX3232 board
https://www.sparkfun.com/products/11189
to convert the signal suitable for the RS232.

The MAX3232 draws its power from the pi and everything is hooked up as follows, with the only differences being that I used the 3V3 pin on the pi, and I don't utilise the 'bottom' part of the BotVac board.
Image
Image
Image

I've disabled the terminal on the pi, and tried to connect to the BotVac using
Code: Select all
sudo screen /dev/ttyS0
(instead of
Code: Select all
sudo screen /dev/ACM0
)

However, whenever I try this, screen is non-responsive to any input and I have to CTRL-A CTRL-D out of it. I figured I may have switched the rx&tx, but switching those is to no avail either.

Does anyone have any clues on where the problem may lie?

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 10th, 2019, 5:49 pm
by valamilamasag
MadAEng wrote:Does anyone have any clues on where the problem may lie?


Yes. You just killed the serial port on the botvac in the best case or did unknown amount of other damage to SOC.
Its a 3.3V TTL serial on the botvac, you could have just connected directly to the PI with two 1kohm resistors.
The MAX3232 creates RS232 level voltages which are up to +-15V (30V swing). The SOC on the botvac operates at 3.3V IO voltage and 1.8V (or 1.2V) core voltage, thus anything under 0V (MAX3232 outputs -15V) or over 3.3V (MAX3232 outputs +15V) will damage the SOC.

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 11th, 2019, 5:45 am
by MadAEng
valamilamasag wrote:
MadAEng wrote:Does anyone have any clues on where the problem may lie?


Yes. You just killed the serial port on the botvac in the best case or did unknown amount of other damage to SOC.
Its a 3.3V TTL serial on the botvac, you could have just connected directly to the PI with two 1kohm resistors.
The MAX3232 creates RS232 level voltages which are up to +-15V (30V swing). The SOC on the botvac operates at 3.3V IO voltage and 1.8V (or 1.2V) core voltage, thus anything under 0V (MAX3232 outputs -15V) or over 3.3V (MAX3232 outputs +15V) will damage the SOC.


FML, wish someone told me that sooner....

Anyways. thnx for helping me solve that mystery.....

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 14th, 2019, 1:04 pm
by valamilamasag
MadAEng wrote: wish someone told me that sooner....


You were told in the other thread. There are countless posts here about that debug interface. You could have easily measured it too, even with a 1 dollar multimeter. Or read what RS232 is and from the measurements quickly determine that it is not RS232.
Alongside where you got the picture in the first post, there is a description about the interface. But pictures look pretty and reading is tiring right?

But I'm curious, did you managed to kill it? Or did one of the ESD/TVS diodes shorted itself and protected the SOC? MAX3232 can only supply a few mA (maybe 15) which if you are lucky sinked away by the protection diodes and dumped into the power line of the SOC.

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 16th, 2019, 7:19 am
by MadAEng
valamilamasag wrote:
MadAEng wrote: wish someone told me that sooner....


You were told in the other thread. There are countless posts here about that debug interface. You could have easily measured it too, even with a 1 dollar multimeter. Or read what RS232 is and from the measurements quickly determine that it is not RS232.
Alongside where you got the picture in the first post, there is a description about the interface. But pictures look pretty and reading is tiring right?

But I'm curious, did you managed to kill it? Or did one of the ESD/TVS diodes shorted itself and protected the SOC? MAX3232 can only supply a few mA (maybe 15) which if you are lucky sinked away by the protection diodes and dumped into the power line of the SOC.


Apparently not clear enough, otherwise we wouldn’t be in this situation now, would we?
I appreciate your previous post cuz that is clear on what needed to be done!
I don’t have much of an understanding of what an RS232 is, and in hindsight, I completely don’t understand why that was brought up in the first place. Like I said in the other topic: I’m a n00b at this. But that is one lesson learned I guess.

Anyways, to answer your question: everything else seems to be working fine.
So on that basis and your apparent understanding of the circuit, in theory it should be possible to fix it by replacing the diodes, correct?

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 16th, 2019, 10:24 am
by glnc222
Background: In the early days of personal computers, and until just a few years ago, serial interfaces were common for peripheral devices and can still be found today. RS232 is "Revised Standard" 232 for such interfaces, from a commercial, industrial main frame computing, not PC, world, with substantial "D" shape multi-pin connectors etc., and use 12v for contact over long cables. Display terminals, printers, teletype machines etc. could have these interfaces. So when referencing serial connections this standard may be mentioned, even though there are logic voltage level (on 5v supply with 2.5v logic high or true) interfaces within devices where cable distance is not an issue etc. Similar devices are used to generate and interpret the data pulses in both -- UART IC's (universal-asynchronous-receiver-transmitter -- converting serial data to/from parallel connections with separate wires for each bit in a character, for the internal data bus of computers; note the UART pins on the microcontroller...). Superseding this old tech are the high speed interfaces with USB and competitors (Apple etc.) today, with more complex signaling methods, differential voltages etc.; the old serial was limited in speed. You would not interface a disk drive with old serial, limited to a few thousand characters per second if even that (the fastest telephone modems were only 9600 bits per second). Serial connections may operate one character at a time while with USB, entire lines of text or data blocks are sent at once for speed as single blocks of hundreds of bits -- similar to disk drive interfaces common on those devices. Neato's USB connection uses software which originally was for a serial interface, where USB packets of single characters are sent at a time, allowing Terminal Emulator PC programs to work.
The serial connection uses timed pulses over a single wire sending one bit of data at a time, with a couple extra status signal wires; printers would typically use a parallel interface with multiple pins, sending all the bits in a character 8-bit byte at a time, the so-called Centronix printer connection (an old brand name). Parallel interfaces filled the need for high speed connections, until superseded by the super speed serial interfaces today. These are enabled by advances in the component electronics for speed. The data "bus" within a computer connects microprocessors with a parallel interface, up to 64 wires, one for each bit in a memory Word or Byte to memory components etc. and operates at the highest speeds within printed circuit boards.
In the RS232 age there was also a "current loop" as opposed to voltage based signaling method, which was used on teletypes machines (the most available early terminal device, with video terminals a luxury). It is suitable for even longer cables. It is still used in the "Midi" musical-instrument-digital-interface for many electronic keyboards, sound synthesizers etc. equipment, maybe for stage-capable use for performance. With MIDI each end is optically isolated as well, generating and receiving light within the interface (not an optical data line like available today) instead of electrical conduction, to protect equipment from any electrical problems in a stage environment with heavy lighting, temporary heavy power wiring, speaker systems etc. MIDI has been somewhat superseded by USB on newer music equipment. USB-to-MIDI adapters are sold.

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 16th, 2019, 1:18 pm
by glnc222
read what RS232 is and from the measurements quickly determine that it is not RS232.


The SparkFun component MAX232 is described in its datasheet at
https://static.sparkfun.com/datasheets/Components/General%20IC/SP3232EBCA-L.pdf
as generating 12v RS232 signals by means of capacitor voltage shifting methods, and cannot be used with the Neato serial interface connector. It is all about the voltage conversion more than serial interfacing.
Connecting this to the Neato serial port edge connector could potentially damage the Neato system board components, with no telling what repairs possible. This port is probably shared with the USB connection on the Neato, but not traced to tell, and uses UART features of the Neato's microcontroller similar to those on the Rasberry Pi microcontroller. The Neato's USB interface just connects this TTL interface to USB (requiring a USB driver IC typically, supply USB protocols besides signal conversion). Digital IC's can be sensitive to input voltages exceeding the power supply voltage on the parts, and some can be burned out; it can depend on what resistences are present to limit currents.

It sounds from above posts there are pins already on the microcontroller for the logic, TTL (transistor-transistor-logic) voltage level interface (these interfaces are used to avoid needing a separate high voltage power supply and related parts on digital equipment running at 5v (an old logic component standard -- same as power supplied on USB connectors) or even 3v as the newer microprocessors run, for power saving and use in battery powered portable equipment).
Using the on-board Rasberry Pi serial interface features is described in tutorial
https://www.abelectronics.co.uk/kb/article/1035/raspberry-pi-3--4-and-zero-w-serial-port-usage

One Sparkfun product for converting USB to TTL serial is "USB to serial bridge" at https://www.sparkfun.com/products/15009 among a bunch of related products, not clear what is the minimum needed. This would only be if you were using the USB connector on the Rasberry Pi, which appears unnecessary for the Neato -- it is for connecting the Pi to the PC only. In fact, it might be useful to be able to connect both the PC and the Neato to the Pi at once for debugging. You could then run a terminal emulator on the PC running through the Pi to the Neato to check responses of the Neato to the serial communications to be done later over WiFi or BlueTooth radio.

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 16th, 2019, 1:49 pm
by valamilamasag
MadAEng wrote:fix it


The ESD/TVS diodes can be replaced, but I assume you do not have the equipment, nor the skill do do it. We are talking about components that are smaller than 0.3*0.8mm. These are unlikely to become damaged, but its a possibility.

If you measure a short to the 3.3V or the GND pin from TX or RX then you are not in luck. Those diodes are inside the SOC. That can't be replaced, only the whole SOC. It requires an infrared pre-heater, a hot air soldering station and the component (SOC) itself cant be sourced either.
Do the measurements in both direction in the diode mode of your meter (measures the forward voltage of a diode). 0.5-0.7V or open circuit (or above ~3V) readings are normal, anything under 0.3V is highly likely a short circuit. Above 0.7V readings does not mean a problem, but could be a sign also. The robot should not have any power during measurements.

Why dont you use the USB port on it? Its a standard CDC device if I recall correctly, the kernel should have the required kernel module already built in.

For testing, do a loopback. Connect the PI-s TX to its RX then you can test that side. If that works then simply connect the PI to the robot's serial with 1k resistor inline, GND directly.
Personally I suggest using an ESP8266 instead of a PI running a full blown linux. The ESP8266 can be supplied by the robot, no need for any additional power supply. Then you can telnet into it (or ssh, or whatever firmware you upload to the ESP8266). I did this and used ESP-Link which exposes telnet. And it fits inside the robot without any body modification (ESP-01 module), runs from the 3.3V exposed on the same debug port.
ESP8266 is a microcontroller with wifi built in.

glnc222 wrote:...

This guy always gives the greatest totally irrelevant, misleading, non answers.

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 16th, 2019, 4:06 pm
by MadAEng
@glnc222: with all due respect, I can accept that it is derived from such a protocol, however, I’ve also worked with MIDI for years, and no one has ever referred to that as an RS232, probably for good reason...

@valamilamasag: what I meant to say was that the normal functions as well as the USB port are in working order like before. I’ve also tried to connect to it using another pi and six 330 Ohm resistors, with no result.

I’ll try to do the measurements as you described when I have the time, but considering the result I had with the other pi, I’m not very hopeful.

I’m aware that trying to straight up solder the board is nearly impossible.
The option that is still on my mind though is that if the diodes are for example D38 and D39 on the board, I could potentially disconnect those by squeezing them with pliers, then bridge that connection by soldering on a normal ‘wire’ diode. However, if they’re contained an another chip (SOC), that’s not really.
Thoughts?

There are a few reasons I want to use a pi, the main ones being more familiar with a pi, as well as wanting to install a camera at some point. It’s also much easier for me to google how to implement some tricks the pi can do with a camera for example. The two biggest obstacles to me are getting the connection going with the dustbin in place and figuring out how to make the botvac communicate with a python script, from there, the sky is the limit.

The problem with the USB connector is the dustbin. I can’t seem to find a bare-bones connector small enough so that the dustbin can close, let alone a wired connector, let alone a cable.
I am considering modifying the bin, but haven’t come up with anything I’m happy with yet.
Either way I’d prefer to use the serial port where it won’t be in the way, but if it’s beyond repair then that limits the options.

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 16th, 2019, 5:46 pm
by glnc222
I am not a Pi user at the moment so do not know what diodes and boards you are referring to, the Neato system board or another part. However, if you want to use that RS232 adapter MAX232 with resistors between it and the lower voltage Neato connection, you could divide the 13v output of that board on TX with a divider attached to ground, not just between the Pi and the Neato. Yet the transmit line from the Neato at 3v will not activate the RX input on the Pi requiring 12v, so communication will not occur.
I do not understand whether you are referring to some difficulty attaching wires to the various connections on the Pi, "soldering straight up", or some other soldering issue.

Ebay shows a bunch of USB-to-Serial TTL adapters for the Pi under $3 from China, e.g.
https://www.ebay.com/i/173729245056?chn=ps&norover=1&mkevt=1&mkrid=711-117182-37290-0&mkcid=2&itemid=173729245056&targetid=595232356549&device=c&mktype=pla&googleloc=9052975&poi=&campaignid=1689799111&mkgroupid=66574331915&rlsatarget=pla-595232356549&abcId=1140466&merchantid=110602581&gclid=CjwKCAjw67XpBRBqEiwA5RCocT1SLrooliMwbH-_Yj8z4lScV5lgaSYPV_vMwT5KR_ETM5VCFER8YxoChVAQAvD_BwE

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 16th, 2019, 6:15 pm
by glnc222

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 17th, 2019, 6:03 am
by MadAEng
valamilamasag wrote:If you measure a short to the 3.3V or the GND pin from TX or RX then you are not in luck. Those diodes are inside the SOC. That can't be replaced, only the whole SOC. It requires an infrared pre-heater, a hot air soldering station and the component (SOC) itself cant be sourced either.
Do the measurements in both direction in the diode mode of your meter (measures the forward voltage of a diode). 0.5-0.7V or open circuit (or above ~3V) readings are normal, anything under 0.3V is highly likely a short circuit. Above 0.7V readings does not mean a problem, but could be a sign also. The robot should not have any power during measurements.


Never used diode mode of my MM before, it reads out about 647 on both RX and TX to GND in one direction, in the other, it jumps to a value when connecting, then immediately jumps out of range again.
Same thing happens between 3.3V and RX/TX, with a value of about 547
I take it 647 and 547 should be read as 0.647 and 0.547?

Re: Help establishing a connection BotVac 85 serial with ras

PostPosted: July 17th, 2019, 4:21 pm
by valamilamasag
MadAEng wrote:0.647 and 0.547


Seems good. A momentary lower reading just means some cap is charging up, expected.
This indicates that at least the diodes are not damaged (and highly likely the SOC survived too).
Did you try the loopback on the PI (just connects its TX to its own RX)?
If that works maybe try a lower value resistor (330 ohm is good). The resistor is only used to limit the maximum current and slew rate. If you still cant get any response from the bot, try restarting it (just hold the clean button) while keeping the serial console open on the PI. The bootloader on the robot spits out a few lines while its starting. This way you can test the bot->pi direction.
To test the pi->bot one just issue a "playsound 1\r\n".
Do you have the baudrate set correctly? It should be 115,2kBaud, 8n1.

MadAEng wrote:sky is the limit

Dont expect much from it. The command set is really limited. For example you cant send it "home". Cant get the map it built, cant get the the state of "is it seen the charger yet", cant set acceleration values, its just launches at full power if you set the speed, or brakes at maximum.
Commands take a relative long time to take effect (up to a hundred millisecond), polling all the necessary info also takes a long time. You can maybe update all the states once a second. The USB port is much much faster, but still takes a long time to poll all the sensors, motors, etc.
The only advantage of the debug port is that it sometimes spits out errors that are useful to diagnose the bot. On the USB it does not do this.
For example: It just displayed a generic battery error on the screen and with the getErr command, but since the ESP8266 logs the output I noticed it was full of *** reportPowerAlert BattChargeBaseCommErr. Or when I had a loose connection with the battery it just stopped mid cleaning without an error (and shut down), but it spit out something on the debug port (dont remember the exact message) with which I was able to hunt down the problem.
My point is: forget it if you want to use it as a generic robot development platform. Its doable, but not worth it. If you want to have remote control capabilities, that's ok.

MadAEng wrote:USB

You can remove the USB connector and solder directly to the board, then route it internally. Also slim connectors exist, something like this: https://www.alibaba.com/product-detail/90-degree-micro-usb-cable-USB_60671252545.html

MadAEng wrote:esp vs camera

ESP32. The complete microcontroller + camera devboard is 8$. It has a dual core 240mhz cpu + half a meg of ram, 4Mb of flash which is plenty. You can run micropython on it, but I recommend the arduino SDK or ESPSDK directly.