Jump to content

Gunners TekZone

Eurobricks Citizen
  • Posts

    210
  • Joined

Everything posted by Gunners TekZone

  1. Personally, I only have three interface-B devices. But using @Bliss's Python Script based method, the limiting factor would probably be only the number of Serial/USB ports, and processing power of the host to keep up with all the communication. These Interface-B's are chatty little boxes Hmm... I think I actually recall seeing yours, over the last year that I had been looking for alternative software options. Unfortunately I seem to recall not understanding enough to figure out how to implement it with whatever maven was. My only prior Java based language use was some small scripts in Node-Red. In the end, I found Python more comfortable, due the simplicity of an IDE like Thonny (Now I am wondering if it works with Java??). And my familiarity of already using it (and micropython) with microcontrollers and PyBricks won me over. But I like learning stuff, when able, so I might look into your Java based option again.
  2. Well, after many days of 1st snow, 6 hour power outage (in freezing cold and all electric heat), dead camera server (faulty UPS??) computer revival/replacement, and even issues with micropython behaviour that just messed up my thinking... (PS, I belatedly realised that there is NO reason to try this on the Win 7 PC, as due it's very nature, a ESP32/Micropython controlled Interface-B needs no serial ports... Doh!)... I can finally concur :D I am running an Pi400 with Mosquitto MQTT broker and Node-Red. And using Node-Red to handle the logic, the Micropython Interface-B has been running over 24 hours. With temp, rotation, button and light (the button and bulb control and indicate the status of a 120v lamp, via Sonoff switch).
  3. Woops... Be aware, not sure if due to the free or Android version, but apparently restoring will wipe out all other connections that were there? Odd. And having almost installed advertised programs when meaning to hit the save button at the bottom, and not willing to spend $12CAD for this at the moment, I might stick with the Virtuino IoT and Node-Red interfaces I already have and understand
  4. It's JSON so not a problem there. Worked great! Thanks! I had started on a couple of settings of my own with that app... as well as some more Node-Red, but between normal grogginess and stuffed sinuses due recent weather change... I fear the more GUI/HMI interfaces I struggle to learn, the greater my chances of forgetting where I live
  5. And I finally got the MQTT part working. Took a bit to realise that, and where in the code, I needed to set the TX/RX pins... Silly me :P That app looks interesting... But looked like it was going to take me a bit to set it up, so I fell back to my Node-Red setup for some basic tests to confirm proper action.
  6. Well, a bit of fiddling around (I still don't really understand the webrepl aspect?? I just use Thonny to run a program) I got an older ESP32 DevKit board to work with demob.py (press button on 1 see light on A) Baby steps
  7. That was a big thing a bunch of us regulars on the BLYNK forum kept having to teach the noobs, never use blocking code!!!... That was with basic Arduino code and Legacy BLYNK (the new version is not as nice, and I gave up on it long ago). Still awaiting my Serial adapter, should be here today?? And I think I will have to simply duplicate what you have done with a basic ESP32, as I am finding micropython a learning curve as is, without also trying to make use of the Wio Terminal or PICO displays I have.
  8. Ahh, the variety of microcontroller toys out there is wonderful. And costly I have a Seeedstudio Wio Terminal that I purchased on a wim, ages ago, but never did anything with. I just realised it supports UART(Serial), micropython and even USB HOST. I'll see if I can use it. Might even be able to make a functional GUI with it for simple output port activations... hmmmm?
  9. Yes... I ended up needed a few when I got my last two Interface-B's... And NULL-Modem adapters. Seams one can never have enough variety on hand. Next on my "when I can afford it hit list" is this... As I seem to be getting back into the older PC tech stuff :P https://www.amazon.ca/dp/B08CDQ76Q8 Wow... Why are these posted image links soooo large??? EDIT: OK better
  10. I just ordered a 4x pack of the Serial modules for $15 CAD from Amazon... Ali would take to long. I should get mine this weekend, and then I can try out your latest interface driver
  11. I hear ya, these are getting rarer as time flows and shouldn't be modded "just cuz"... I only did so as it was otherwise already "dead". What I was referring to was that, using my already modified one, would mean that the communication between the ESP32 and Int-B would need to be via the USB-USB connection (not serial) as that is now that particular devices only link to a PC. But that would probably require the ESP32 to act as a USB host. Something I haven't messed with yet. Actually, I am kinda dreaming of a battery powered option for both the Interface-B and ESP32 for true portability. I can barely hope to keep up with you!!
  12. Ohh, nice! You have been a busy beaver, Eh! I don't normally search on Eurobricks, but I had a gut feeling... And I found this recent gem! Yes, I recall you mentioning something like this. I don't have that serial board, but I do believe the ESP32 can send serial through the USB (as used in an IDE serial monitor) so I wonder if I can make this work on my modded Interface-B? I will look into that when I can.
  13. I don't think this is the intent of Bliss's process... But it would be nice! That said, from a little Googling, running Python or even MicroPython onboard might not be a possible, or feasible, option on these little ol' yeller bricks Too slow and not enough memory. But as there are already many onboard OS options (Too many... I gets confused, thus never managed to use any of them), I would be happy with data/control/interaction sharing between an onboard OS of some flavor, and a PC running Python, handling communication with other newer devices running PyBricks.
  14. How about 2025.01.20.x With x reverting to 0 on next day? Reason I say, is that I already used the file creation data to try and determine if I am running latest version or not. Might as well keep the internal script version labeling the actual date of update (else confuse the snot out of people like me... "Whhhaa?... Did I sleep through the last few days or something?"
  15. Nice! That worked on my original script right away And, yes you are correct... No need to the pauses in the switch routine. Now more responsive in the stepping.
  16. OK... looks like it might be a python version thing... I had a "Doh!" moment and realised I have more serial IR towers, so can quickly swap the script and RCX between PC's for testing. Tested on Win10(64) with Python 3.12.8 and it recognised the button press. from legorcx import RCX import time rcx=RCX("COM2") # use the com port for you IR Tower. rcx.snd(1) # should play BEEP BEEP rcx.sensor(1).type(rcx.TypeTouch) # configue input 1 as a touch sensor rcx.mot(rcx.A).pow(7) # Set power to max rcx.mot(rcx.A).on() # run lamp on output A print("Dimming... Press button to step") for x in reversed(range(8)): print(x) rcx.mot(rcx.A).pow(x) while not rcx.getval(rcx.SrcSb,0): pass print("A = OFF") rcx.mot(rcx.A).off() time.sleep(.1) # needed to give prior command time to process before next command rcx.close() Dimming... Press button to step 7 6 5 4 3 2 1 0 A = OFF Shutting down.
  17. Same error... Although I just realised that it is NOT in response of my pushing a button (I forgot to put the button on the 2.0 RCX I was testing at the time)... It just takes about 2 seconds after getting to that line of code, before throwing the error: File "C:\Users\Gunner\Desktop\RCX Python Script\legorcx.py", line 174, in getval v=(r[f+7]<<8)+r[f+5] IndexError: index out of range firm0332.lgo on both RCX 1.0 & RCX 2.0 legorcx.py __version__ = '2025-01-12.' Windows 7(32) Python v3.8.10
  18. I have been briefly messing with this. Attempting to use a touch sensor to step through an action... But I am getting a strange error. Doesn't seem like a syntax issue, but what do I know :P The code: print("Dimming... Press button to step") for x in reversed(range(8)): time.sleep(.5) rcx.mot(rcx.A).pow(x) # Set speed to minimum pow(7) is the Maximum v = rcx.getval(rcx.SrcSb,0) ### EDIT: This is line 36. Also I tried all the numbers, but I beleve 0 is the correct one for input 1?? while not v: time.sleep(.5) print("A = OFF") And the error once I press the button: Dimming... Press button to step Traceback (most recent call last): File "C:\Users\Gunner\Desktop\RCX Python Script\test.py", line 36, in <module> v = rcx.getval(rcx.SrcSb,1) File "C:\Users\Gunner\Desktop\RCX Python Script\legorcx.py", line 174, in getval v=(r[f+7]<<8)+r[f+5] IndexError: index out of range I get the same error if I use this, instead of setting a variable to the button value first: while not rcx.getval(rcx.SrcSb,0):
  19. Well... It only took me 5 hours to diagnose and fix... (and I really was at it the whole time... I is tired)... But it turns out I DIDN'T mess anything up with the capacitor relocation... Wow And FYI, isopropanol will weaken hot glue connections, so that was easy to remove. I was getting very high resistance over the 9v line (14+kohm). And while testing, it broke at the main board joint. So I replaced it... only to have the grounds also break... AH HA!!! It was the 30 year old ribbon cable solder joints (EDIT: Actually, the solder joints were fine, the rather rigid and non-copper wire in the cable simply fatigued very quickly and snapped right at the joint). For all I know, that ribbon cable might have been a contributing factor in the serial connection??? I did so many tests, but didn't see any visible issues. Oh well, too late now, it is "improved", deal with it So anyhow, after way too much time and effort to remove, not the ribbon cable, as that all but fell off in spots, but the remaining little bits in the both board's through hole connections. I then replaced with new wire, tested voltages as good, and reassembled it. It works great! End of story... ... I hope
  20. Whew... desoldering (and resoldering) with a dual sided ground plane is surely fun for the whole family! NOT! Thankfully, I had a new capacitor of same value (higher voltage rating, which doesn't matter) and the new leads allowed me to reorient it along the back. I didn't really need to use the leftover lines on the ribbon cable, so I got them out of the way as well. The USB-TTL board nestles in with Tessa tape on the capacitor side and Kapton tape over the regulator...Followed up by a few layers of "alien" tape. Basically thick double sided adhesive tape. I highly suspect I will need to flow a generous amount of hot glue around there to keep that board in place as one plugs and unplugs it. Instead of trying to figure out how to safely solder to the CPU pins, I traced both TDX and RDX leeds to where they entered and exited the serial circuitry, which is now isolated by removal of the resistors, and soldered my leads there instead. As well as to the ground plane. Please don't judge my messy work, Hah! It is much much smaller to work on, even with magnification, than it appears in this image. A little hot glue or superglue will keep everything in place once I have thoroughly tested. Another sanity check and plugged everything in. Yay, it still works!... Always a good thing! ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Hmmm... Well, this is a bit disappointing... Everything is working on the inputs and outputs, but slower and dimmer on the outputs. My initial power checks showed 8.9v on the test port. But now I only have 4.6v with nothing else running. Hmmmmmm... The USB-TTL is powered by the PC, so that shouldn't be drawing any power. So now I have to figure this out, or forever run this at half power... Something I can relate with, but not approve of :P Oh well, thank heavens I still have some issue to nag at me... I was concerned I might be done thinking and have to go back to some Netflix bingeing :D I think I am going to have to double check that capacitor I replaced. It is the correct 220pf but perhaps it is not making a good board connection... Those ground planes do make for difficult soldering. I am not well versed enough to be sure, but if I messed up that capacitor, then it should affect the 5v logic (which is apparently working fine), not the 9v output port voltages... Gotta open it up again :P
  21. Wow... I can see if I m going to get back into electronics, I need to seriously upgrade my desoldering toolset. Those cheapy spring pump things are bad, but I have nothing else, not even wick. Thankfully I need not make use of those pads anymore. BUT... I was clearly in a zone (twilight zone?)... I didn't realise that if I expect to put this USB-TTL adapter in there, I need to relocate that capacitor, which is so nicely gooped in :/
  22. Theoretically, they had to scan the area?. But I would probably prefer the Jumper method (required a viewpoint of destination??). Cross over whole at a joined time/space local as opposed to getting "killed" (however you look at it, that's what seems to happen) and "rebuilt" after transmission. The spirit is immortal, this body... not so much, and I would like to keep it together for as long as possible However the geeks and nerds debate it... I personally think a jet might have to be involved :D But for now, I will follow along in these fun technical LEGO discussions!
  23. eh... no worries. As long as I can Google, I get by... Makes me wonder how I learned anything in my youth (oh, right... despite dyslexic tendencies, I always was/am a very competent reader. And great at trial and error :P If I get back to the point of having the energy to leave the house for more than a quick weekly foodbank/grocery store trip, I might contemplate such an adventure (oh, wait, I don't care much for travel... I better get working on my teleportation skillz )
×
×
  • Create New...