Jump to content
THIS IS THE TEST SITE OF EUROBRICKS!
THIS IS THE TEST SITE OF EUROBRICKS!

Bliss

Eurobricks Vassals
  • Joined

  • Last visited

  1. I see so 4A total for 8 outputs, but the box must allow it. So is there a main protection at the power intput of the interface?
  2. Is there a fuse or other protection inside? I'm certain that with the original PSU, 8 outputs of interface B cannot power 8 X 9v lego train. But could it do it if we use bigger PSU? Of course, the thin board power trace must be able to take it... (I'm pretty sure it cannot take 10A though)... But maybe 2Amps?
  3. The original Lego PSU is 12VAC 7VA so we talk basically of 600mA at 12 VAC for the whole box... It not much... Can the Box use more amps if we connect a bigger PSU say 12VAC at 2A (24VA)? No matter USB-C or USB-A, from a computer port it is not like a PD Charger I think... I would use the USB from a computer to have both DATA and Power. But anyway, saying this, google tell me: Most computer USB ports supply 5V of electricity with a maximum current of 0.5A. So maybe not enough to use the interface at least like the spec... but still...
  4. What would be great is to have an easy solution to get rid of the Serial data cable and the PSU 12VAC 7VA. So removing the RS232 circuit and replace by a FTDI USB input USB-C or USB-A. And, use the 5V from the USB with a step up board to provide 9vdc at about 1A or less. I don't know what the lego outputs capacity... but 7VA is not much... I think a USB port on a computer should be able to supply the whole thing no?
  5. @Gunners TekZone, wow you're da man! Not much people still play with those Interface B but they are quite unique in some way as they offer the most quantity of inputs and outputs in one box... And if you can connect 3 or more on a same PC interface, it offers 24/32 Inputs and same for outputs all available in one programming environment to achieve big projects. I have an EV3 kit but never opened it yet... So I don't really know how it can expand itself and interact with other EV3 or other systems... But I see these RCX, EV3, NXT more like small standalone controller that have there own independant program and very limited IO capability... I understand that like the RCX, EV3's probably have a way to send messages between each other but it's not the same... Can one EV3 expands its IO capacity somehow? Did lego completely stopped production of mindstorm? I see today in their education line some spike and BricQ ? technic hub? EV3 is marked retired. I'm clearly behind on this :-) Are they working on a new version? That would be great if they could enter the IoT world making wireless sensors using battery button like zigbee and BLE stuff... (Touch, light, temperature, IR motion sensors). (Wires can be a pain in projects) Is there a thread about what would be the best new Lego Smart System for you ? I think I saw on TikTok, lego projects using motors and electronics I've never saw in a lego store... Third party bricks?
  6. @Toastie, I just read some of your thread about mulpi. Wow, I feel so amateur now haha... Great achievement. I found in your thread quite a few valuable information. I also installed this SDK 2.5 which is great as it contains information about many bricks and the RCX version 2 firmware! That made me add some features in the RCX Python module. (See link in first post, I also updated the README). - I already had the rcx.prg(progno) command but now it has a default value of 1 so you can call rcx.prg() with no argument for prog 1. - I added rcx.start(taskno). default is 0, so rcx.start() start task 0 which if I undersand well, has the same effect as pressing the run button on the brick. taskno can be from 0 to 9. - I added rcx.stop(taskno). default is -1. taskno = 0 to 9 to stop a specific task but any other numbers will stop all task which I think, has the same effect as pressing again on the run button while a program is running. - I added the rcx.msg(msgno). No default value, msgno is mandatory and can be from 0 to 255. Avoid 0 as mentionned in NQC documentation. It sets the IR message buffer with the given value. The set message command is really interesting as it allows, I'm guessing, to have a message sent to RCX program. So more than one RCX could read this message coming from the same IR Tower. But each RCX could have a different program running that waits for different msg numbers to take different actions... I'm gessing again that it might be interesting for train layout to activate remote train switch from a central point ... I also added a small delay between each command, 100 ms (took this number from Toasties thread). Because if you send too much commands in a row, eventually I had to close my serial connection and reopen it... For exemple: for i in range(10): rcx.snd(2) This code before the delay addition, would play sound only once and no more commands were accepted thereafter. With the addition of the 100ms delay between commands, this same for loop plays the snd 10 times. After this 100ms, I now read the reply from the RCX but I do nothing with it yet. For now, this is only to avoid accumulating too much in the read buffer and also it allows me to understand the decoding of the replies.
  7. it should but it would be great to have someone to confirm. I guess the "COM1" port in the examples would rather be something like "/dev/ttyUSB0"... Make sure you have latest version of python...
  8. I updated the legob.py file and corresponding readme.txt. I changed the behavior of off() to brake stop rather than coast to stop. to be consistant with legorcx.py... brk() has been replaced by float() that will coast to stop. (Like rcx...)
  9. I'm testing here the bricksafe file hosting to show images as proposed by @Toastieand @Gunners TekZone. This one shows a Thonny Python session. Left pane show the working directory with the LegoRcx.py file in this folder. LegoRcx.py module is also opened in the editor on the upper right. It also shows the Shell at the bottom and how to test the Lego Rcx module.
  10. Extract from Python discussion: While programming python module for RCX, I wanted to use a function that I saw on Pyton doc for the Queue, it is Queue.shudown(), but it did not work at all. I was using the Thonny integrated Python which is version 3.10.11. Then if you read carefully the Python Doc, here the extract: See the last statement ;-) Then I thought about you and refrain from using this shutdown method lol. So maybe I should reformulate what I said. "Some python function I use MAY not be compatible with Win 7" but I count on you to let me know :-) Python seems to be the trending in script language tofay. But they make some changes from one version to another that are not backward compatible sometime. Like this 10 year old DACTA lego interface B module from Shamlian. Probably done from Python 2.x... or even 1.x... Not working anymore... Anyway, we'll see in 10 years from now :-)
  11. First, here are the links to my dropbox project files that I will keep updated: Lego Demo B to Test multiple Lego Interface B (70909) Lego Script B: an EXE executable C# program that integrates IronPython (No need to install Python separately). Lego Class B: A C# DLL that can be linked to VBA programs (Excel for ex.) or even Python Lego Interface B Python module to be used with Python only. Lego RCX python module that manage serial communication using Serial IR Tower only (Not USB) I'm now putting my efforts more towards the use of Python. I'm using the latest 3.13. Some python functions are not compatible with windows 7 but until now, I've had some report that my python scripts still works on windows 7... I do not garantee this is going to be always the case but I'll do my best to keep it working on win7... My first goal was to make a simple programming environment that works on modern PC computer and OS and allow the interaction between multiple Lego Interface B, expanding the IO capability... I posted first on the following thread: https://www.eurobricks.com/forum/index.php?/forums/topic/67665-dacta-control-lab-software/ But since I'm now expanding the project to the Lego RCX (After other members ideas), that lead to the creation of this dedicated thread. There are README files in the above links to help you test and integrate these Python modules in your project. Note about the Lego RCX Python Module: This is for sending commands like Start/stop motors through serial link using IR tower. This is not to upload programs in to the RCX. You still need programs like Brickx CC and NQC to make programs that will execute into the RCX. To give you an idea: A python main program user project may import the LegoB pyhton module, and import the LegoRcx python module as well at the same time along with other modules like MQTT etc... The Main python script could have programming that allow interaction between multiple Lego Interface B, multiple RCX, MQTT (External World, Smart Home, etc)... Feel free to comment, report bugs, suggest improvements, share your project on that matter, add other python lego modules like maybe the Interface A. Is there other old forgotten interfaces (Serial)? Blis
  12. @Toastie Thanks for feedback on that matter. Is it a driver? maybe more a communication gateway? Right now I just want make a dumb interface with the RCX like the Lego Interface B is. So sending through communication commands to activates outputs basically. For the moment, I do not read any acknowledgement from the RCX but I will probably add this feature, not for the acknowledgement for the commands Python sends when we want to activate outputs but to ask for the status of RCX inputs like we do for Interface B. The basic goal to achieve is allowing interactions between multiple old serial lego interfaces and also interaction with the external world using ethernet (MQTT as an exemple). Example: - A master Python program running on a PC that has many serial ports and have ethernet connectivity and integrates MQTT client "driver" as well as Lego Interface B serial driver and RCX "serial driver" and maybe more (web server etc). - An IKEA zigbee button might send a signal to your smart home hub like Home Assistant that has MQTT broker addon installed. - an automation in the smart home hub could then send a special MQTT topics that your python main program has subscribed to. - Upon receiving the MQTT topic, the Main program could then start some sequence of events that is: - Send commands to RCX1 to activate a sound, then change the position of a lego train switch by sending a command to activate output A of RCX1, and then start a lego Train by sending a command to Lego Interface B #1 to activate its output # H. - Python main program train sequence may wait for a light sensor to be received from Lego Interface B # 2 and than ask the RCX 1 to activate output #2 (antoher train switch or a light ). The Python main program could also ask an RCX to activate an RCX Program that would have been previously loaded into the RCX memory with Brickx / nqc. So for now it is really to make python act like a mindstorm remote control for RCX at some point. But eventually with more features... I have no intent to make another RCX language. This 332 firmware is interesting as it allows to send/receive data with the RCX and also to run programs executing on the RCX (programs writen with nqc from brickx or writen with original lego software)... Many questions remains for me that I will answer through more testing/reading/from other member's help: If there is a program running on the RCX, does it still listen to Remote serial commands (can we still sens motor commands)? Is it possible to stop a program remotely? (haven't seen yet an opcode to stop a running program, but I saw stop task...) Does RobotC firmwares allow the same serial communication protocol than 332 firmware? Maybe the best, would be to create a thread titled: Using python as a hub to communicate with old lego interfaces (RCX, Lego Interface B, and maybe more?) Then, we could talk about Lego Interface B, RCX etc and even maybe other "Driver" in the future provided by others like Interface A etc... (That I do not own unfortunately) EDIT: I just created:
  13. I loaded the firmware firm0332.lgo. I think remote commands do not work without a firmware.
  14. @Gunners TekZone, @Ax4478, and for who might be interested. I got an RCX brick few days ago with its Serial IR Tower and I managed to find in this forum and google some information. The following link seems to be the most complete to explain the serial protocol and list all opcodes etc... https://www.mralligator.com/rcx/ So I started to make a Python driver and right now I have a draft version that takes care of only output commands (Not all yet but some interesting ones). I will refresh the following link as I add features and fix errors that you may find :-) link for LegoRcx.py python driver for RCX brick serial communication. Note that this is not for the USB version. Only the serial RS-232 IR Tower. You can use the shell in Thonny IDE or any other shell like the one that comes with python. I personally use Thonny. Copy the LegoRcx.py in your working folder (that you navigate to in the Files left pane of Thonny for ex). Then in the Shell: >>> from LegoRcx import RCX >>> rcx=RCX("COM1") # use the com port for you IR Tower >>> rcx.snd(1) # should play BEEP BEEP >>> rcx.mot(rcx.A).on() # run motor on output A >>> rcx.mot(rcx.A + rcx.B + rcx.C).on() # run motors A, B, C >>> rcx.mot(rxc.B + rcx.C).off() # stop motors B and C (Brake) >>> rcx.mot(rcx.A).float() # coast to stop motor A >>> rcx.mot(rcx.A).on() >>> rcx.mot(rcx.A).r() # Set reverse direction. >>> rcx.mot(rcx.A).f() # Set forward direction. >>> rcx.mot(rcx.A).flip() # flip direction. >>> rcx.mot(rcx.A).pow(0) # Set speed to minimum pow(7) is the Maximum >>> rcx.prg(5) # Set program #5 (can use 1 to 5) >>> rcx.close() # Shutdown serial communication and any threads gracefully. About the prg method, since I have no program in the brick yet, I can see the program number changing but I do not know of it will actually run the program too. I have not seen a Run program command in the list of opcodes. However I saw commands to start tasks... I do not yet know the structure of the programming of the RCX... I guess I should post further development for the RCX Python driver in another forum thread? Maybe this one?
Sponsored Links