{"id":1420,"date":"2018-08-31T11:18:49","date_gmt":"2018-08-31T10:18:49","guid":{"rendered":"https:\/\/ofalcao.pt\/blog\/?p=1420"},"modified":"2018-08-31T12:11:58","modified_gmt":"2018-08-31T11:11:58","slug":"the-end-is-near","status":"publish","type":"post","link":"https:\/\/ofalcao.pt\/blog\/2018\/the-end-is-near","title":{"rendered":"The end is near"},"content":{"rendered":"<div class=\"seriesmeta\">This post is part 8 of 8 of \u00a0<a href=\"https:\/\/ofalcao.pt\/blog\/series\/sniffing-the-lego-interactive-motor\" class=\"series-341\" title=\"Sniffing the LEGO Interactive Motor\">Sniffing the LEGO Interactive Motor<\/a><\/div><p>Holidays end today.<\/p>\n<p>And finally got something repeatable with the motor.<\/p>\n<p>The motor talks at 115200 bps, 8N1.<\/p>\n<p>It expects an Init command. And it asks for it (or at least it complains of something). But it also requires some sort of warm up procedure that requires sending to the motor a lot of &#8217;00&#8217; for a while. It seems like a long break before start communication but for some reason it doesn&#8217;t work if I use pyserial break command.<\/p>\n<p>Python code <a href=\"https:\/\/github.com\/JorgePe\/re_interactivemotor\/blob\/master\/initialcode\/listen02.py\">here<\/a>.<\/p>\n<p>Tried to use it in EV3 running ev3dev but no success. 115200 might be to much for the Ev3&#8230; or it&#8217;s just my bad programming skills.<\/p>\n<p>And this is the FTDI Beefy 3 adapter that I&#8217;m using:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large\" src=\"https:\/\/lh3.googleusercontent.com\/Lyva0ydeUcotbZzL6aN_JZny0zMKZ7Ly2vGvt6Lh52hRZoDhYRac5iMb0fdUtOC1GIvIl_haVBu7a0hmUF6by6zodQ_s_Sec9ckhWUoYvrQY7aSB6uxwr_QKxRgGngVZIkd7xqe4kg=w1920-h1080\" width=\"867\" height=\"1080\" \/><\/p>\n<p>To recap the wiring:<\/p>\n<ul>\n<li>FTDI GND (black wire) to pin 3<\/li>\n<li>FTDI 3V3 (red wire) to pin 4<\/li>\n<li>FTDI TX(white\/grey wire) to pin 5<\/li>\n<li>FTDI RX (green wire) to pin 6<\/li>\n<\/ul>\n<p>And a sample of the output:<\/p>\n<pre>Speed   : 00 (h) =  0 (d)\r\nPosition: 00   00   00   00 = 0  degrees\r\nCRC     : 27 (h) =  39 (d)\r\n\r\nSpeed   : 11 (h) =  17 (d)\r\nPosition: 09   00   00   00 = 9  degrees\r\nCRC     : 3F (h) =  63 (d)\r\n\r\nSpeed   : 1D (h) =  29 (d)\r\nPosition: 13   00   00   00 = 19  degrees\r\nCRC     : 29 (h) =  41 (d)\r\n\r\nTimeout -&gt; Resync\r\nSpeed   : 04 (h) =  4 (d)\r\nPosition: 9D   00   00   00 = 157  degrees\r\nCRC     : BE (h) =  190 (d)\r\n\r\nSpeed   : 00 (h) =  0 (d)\r\nPosition: 9D   00   00   00 = 157  degrees\r\nCRC     : BA (h) =  186 (d)\r\n<\/pre>\n<p>The script is still far from perfect &#8211; I was rotating the motor half a turn clockwise and it lost communication in the middle&#8230; but at least it reconnected fast enough to preserve position.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"seriesmeta\">This post is part 8  of 8 of \u00a0<a href=\"https:\/\/ofalcao.pt\/blog\/series\/sniffing-the-lego-interactive-motor\" class=\"series-341\" title=\"Sniffing the LEGO Interactive Motor\">Sniffing the LEGO Interactive Motor<\/a><\/div><p>Holidays end today. And finally got something repeatable with the motor. The motor talks at 115200 bps, 8N1. It expects an Init command. And it asks for it (or at least it complains of something). But it also requires some sort of warm up procedure that requires sending to the motor a lot of &#8217;00&#8217; &hellip; <a href=\"https:\/\/ofalcao.pt\/blog\/2018\/the-end-is-near\" class=\"more-link\">Continuar a ler<span class=\"screen-reader-text\"> &#8220;The end is near&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[],"series":[341],"class_list":["post-1420","post","type-post","status-publish","format-standard","hentry","category-sem-categoria","series-sniffing-the-lego-interactive-motor"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Mhyv-mU","_links":{"self":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/comments?post=1420"}],"version-history":[{"count":0,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1420\/revisions"}],"wp:attachment":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/media?parent=1420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/categories?post=1420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/tags?post=1420"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/series?post=1420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}