How to get current connected COM ports within teraterm macro? - macros

I'm using macro in teraterm.
I wanna use multiple devices with usb-serial cable and I opened each COM ports and macro.
I test 4 devices.
I send cat command, parse result, show result via messagebox.
When I executed same macro for each terminal, there's some problem.
I couldn't identify which messagebox is belong to specific device.
So, I thought of two ways.
First one is make 4 macros and each script has diffent messagebox position.
Second one is make just one macro and show the name which is the port number of current connected device.
Anyone can show me how to get current connected serial port number?
Thanks in advance.

Related

Re-program STM32F102 trouble

I am trying to make some custom firmware for a MIDI controller (AKAI LPD8).
There is an STM32F102R8T6 chip in the unit.
I am trying to reach it with a programmer to wipe it, but it seems to not be responsive.
Some information and thing I have tried:
The firmware that came with the unit works, so the chip is not broken
Removed the components connected to the programming pins (PA9-PA10 and PA13-PA14)
I am able to pull BOOT0 high and have it not run the main program, but I am however not able to get a life sign using either an ST-Link2(clone) connected to PA13/14, nor a USB to serial adapter connected to PA9/PA10, so I am not sure what mode it is in
The connection has been checked, and RX-TX etc is the correct way around (but also for the sake of trying it all, I reversed the connections as well...).
Tried both the STM32CubeProgrammer and stm32flash, but none connects.
I am actually not sure if AKAI have locked the chip in such a way that you cannot even do a full chip erase and use the chip for something new? The NRST pin is strangely not doing anything to the running of the firmware either when I try to pull it low.
Is there a way to reprogram these chips when they come off of a commercial product, or are they permanently locked?
Any solution/tips?
Many of the STM32 parts have "proprietary code read-out protection" (google PCROP) which but you might be lucky and they haven't enabled it in the option bytes. Read the documentation for that and the bootloader documentation and get a good idea of what you expect it to do if it is enabled and if it isn't.
If you have a scope, try watching the SWD/JTAG pins to see if there is any response from the device. (If you aren't even sure if it is in reset then scope the crystal if there is one).
If you haven't got a scope, you might be able to to verify what it is doing by seeing if it sets the pins and pull-resistors to how they would be expected to be in the bootloader mode, eg: UART TX should be high if it is enabled, even it it isn't transmitting anything. Put a strong pull-down (~1k) on there and see if it still reads high.
After hours of trying different ways of making it work (also tried the alternate mapping of the UART port), and probed the TX pin as suggested by Tom V to no avail, I have given up working on that specific chip and ordered an upgrade from the STM32F4 family instead to replace it with. A lot more power and useful peripherals.
A bit of a non-answer to the specific question. Frustrating to not have found out what was wrong (chip or approach) but being mindful of the sunk cost fallacy, I think it was best to just replace the chip with a fresh one and start development from there.

Set up ELM327 to behave like FTDI - just forwarding commands without OBD init

My first question on here so I'm not sure if that's the right forum.
I've connected with my car's ECU K-Line through FTDI-OBD cable and terminal. Found it's something like KWP2000 but without preinit hassle. I just send it commands on 9600 baud, even parity, 1 bit stop and got a reply with VIN number. When I try to send same command with ELM327 it doesn't work and I believe because of ELM adding something, either initialisation of the KWP or adding some checksum or additional info and it doesn't work.
I've already tried using
ATSP5
ATIB96
ATBI
And it still doesn't respond eg. VIN message from sending same command.
My point is to get to secret sensors data from $21 because there is a little info in regular Mode01. And I want to use ELM327 because I wanted to use Android phone to display the data.

macOS system events for network status in Swift

is there any system event which I can use in my program to detect a network change on macOS? I would like to call a function if the network state change, without having a lookup every x seconds in my program. Currently I'm using 'scheduledTimer' to make a lookup...
Is there a better solution for that?

How do I programmatically turn on/off Mute Groups on my Behringer X32?

I've got a Behringer X32 rack, which uses an extension of the OSC (Open Sound Control) protocol. This particular rack communicates via UDP packets on port 10023. A fellow named Patrick Maillot actually has some pretty extensive albeit unofficial documentation of the protocol, including multiple executables you can download to interact with the system (outside of the official Behringer apps).
What I would like to do is pretty simple, though I'm having a hard time getting up to speed with this. I want to be able to mute and subsequently un-mute Mute Group 1 on my device. The mute group is already set up; all I want to do is utilize the protocol to either activate or deactivate it.
I can successfully connect to the rack using the X32_Command.exe program. But wading through the documentation, here's what I came up with as my best guess for which commands I should be sending:
/config/mute/1/ON
/config/mute/1/OFF
However, I don't think I have the syntax right (or maybe I've just got the wrong set of commands altogether), because those don't seem to do anything. In the X32_Command.exe console application I appear to receive the following responses when issuing those commands, respectively:
->X, 20 B: /config/mute/1/ON~~~
->X, 20 B: /config/mute/1/OFF~~
However, nothing actually happens on the rack. The mute group isn't affected at all when I issue these commands. How do I get this working? What am I doing wrong?
Just saw this (better late than never). The correct syntax for X32_Commmand.exe would be (as stated in the documentation):
/config/mute/1 ,i 0
/config/mute/1 ,i 1

how does keyboard input reach the right virtual terminal in GUI

Lets say we have an 8 core system running linux and you are using GUI desktop and have 10-20 terminal open.
When you type something, the user input appears on the correct terminal. How does that happen. For example the keyboard interrupt can arrive on any of the cpu, how is it routed to the correct process is my question (given that at a time 10 processes are waiting for user input)
This is what I know:
Keyboard driver will have an interrupt handler that reads the input and copies it to a buffer which might be processed by some high priority work-queue. (not necessary but that is what I feel will happen)
This buffer has to be copied into buffer of the file descriptor for stdin of the currently active shell.
What I don't know
How does the work-queue work function determine which process is running the currently active shell.
It just does know. One of all of the process is marked as the current for console I/O. You switch to another, that other gets marked as the current. I don't know the details of the implementation, but that's the idea.
The work queue function does not determine which process is running - this is done at a much higher level. The keyboard device is exported by the kernel through a device file in /dev/input/ (on my system it is /dev/input/event3 - you can look at /dev/input/by-id to see which one corresponds to your keyboard). This device file is opened by the X server in order to receive the events (look for the device file in /var/log/Xorg.0.log to see where this happens). The X server thus receives all the keyboard events and dispatches them to the right client itself. Knowing which window has the focus, it can put the corresponding input event into the client queue queue and send a signal to the corresponding process, which is waken up and can process the event.
See http://en.wikipedia.org/wiki/Evdev and related links for more information.