Error: "job pending on /dev/sda1" when plugging in USB device - unix

On my raspberry pi running raspbian (unix based i think) I get this error "job pending on /dev/sda1" every time that i plug in my USB flash drive. from my research it has something to do with mounting and un-mounting the device but I'm new to command line and most other posts are over my head. What do i do to fix this error?
if it matters i'm running a script on the pi that writes to that flash drive

Your desktop (LXDE for Raspberry Pi) has spotted that you have inserted a USB disc and has tried to mount it. You can enable or disable this behavior by editing the file ~/.config/pcmanfm/LXDE-pi/pcmanfm.conf and changing the line
mount_removable=1
to set '0' instead.
You would get that error if there were more than one thing trying to mount your USB disc at the same time. The second to run will notice that the first has already started a job to mount the disc.
Are you running two copies of your desktop GUI? (You may not realize that you are, but if you have a VNC or XRDP service you probably will be.)
If that is the cause of your problem (and probably in any event) the message is harmless. Something will have mounted your USB disc (perhaps you can even see it in /media?) The only infelicity will be that your desktop won't show you the results (e.g. by displaying the drive in a file manager.)

Related

STM32: Unable to successfully load BLE firmware because of FUS_IMAGE_NOT_AUTHENTIC so my code is failing in SHCI_C2_BLE_Init()

I have a custom board with an STM32WB55CEU (512K Flash) that is failing to start the BLE stack on CPU2 in the function SHCI_C2_BLE_Init(). I believe it's failing this function because it failed to load the BLE firmware (stm32wb5x_BLE_Stack_full_fw v1.13.0) correctly. Whenever I try to load the firmware I get an error at the end saying FUS_IMAGE_NOT_AUTHENTIC or FUS_STAE_IMG_NOT_AUTHENTIC depending on whether I try it from the command line over USB or through the GUI over SWD. I can delete the firmware image without error and my FUS appears to be up to date and running before I attempt the update.
Firmware Update Screen from STM32CubeProgrammer
Security Configuration Option bytes
I've also tried deleting the firmware by changing the RDP register from AA to BB and back. I still get the authentication error. This only happens on about half of the boards that I've loaded (13 out of 25). I feel like there is an address of setting somewhere that I'm not setting correctly and since all of the other posts I can find on this issue use the Nucleo with the 1MB flash part I'm not sure if my parts settings should be different. I am putting the FUS and BLE firmware at the correct address for my part according the v1.13 release notes.
Any help to get past this authentication issue would be appreciated. Thanks.

User-friendly way to access serial port?

I'm writing an app that allows an Arduino plugged in via USB to send serial data to the app to graph it in realtime. It can scan available ports for the Arduino and attempt to connect to it, but I'm running into permissions issues whether I use pyserial or QtSerialPort. I have added my user to the groups tty, uucp, and dialout. (When listing ports I see that they belong to uucp.) This doesn't seem to do anything. I can chmod a+rw the port every time the Arduino is plugged in but this is not practical because less technical users (i.e. my kids) need to be able to plug it in and use it via a GUI that I'm writing. I've seen suggestions to run the whole script with sudo but this seems less safe than it needs to be, and also requires typing in the command line.
Is there a way to read from the serial port without resetting permissions every time I plug the USB cable in? Or if not, is there an accepted way to do this from the GUI to make sure the permissions are right before the attempt to connect, without running the whole program as sudo? I'm building this on Linux (Arch) btw.
I solved this using udev rules. I created the rules file, which I called /etc/udev/rules.d/80-arduino.rules, and inside I put the following:
SUBSYSTEMS=="usb", ACTION=="add", DRIVERS=="usb", ATTRS{idProduct}=="0042", ATTRS{idVendor}=="2341", ATTRS{manufacturer}=="Arduino (www.arduino.cc)", ATTRS{serial}=="85734323231351404021", RUN+="/bin/arduino_added.sh", RUN+="/bin/device_added.sh", MODE="0660"
This selects for my specific device by serial number as well as manufacturer (ATTRS{serial}=="85734323231351404021"), runs a little script that writes something to a logfile it creates in /tmp (for debugging), and the MODE="0660" opens the port with permissions to let it be accessed.
I had to mess with it a bit to get it to work. Running sudo udevadm control --reload was enough to get the script to write to the logfile each time it was plugged in, but I had to reboot the computer to get it to work with the permissions for some reason.

raspbian : execute a command each time ttyUSB0 comes up

I have a raspbian with an USB connection to an arduino (/dev/ttyUSB0).
I would like, each times I replug (after unplug it), to run command, but I have no idea how to do this.
Reset the speed configuration and restart the program that use it.
Does someone known what to do ?
Ports are in any Linux represented as files. So you can make script in any language which in loop will be checking if the file with specific name exists (The name of port you looking for). If the file is detected than you can execute what you want.

How do I send keystrokes/interative gui to another Win10 machine?

I'm currently using AutoHotKey to create a variety of macros. I have two desktops side-by-side in a private (home) network. It is my desire to have the AHK Run command on PC1 make some sort of call to PC2. Both PCs are running Windows 10 (non-domain), and both use the same login credentials (same account via microsoft.com).
What I've tried: I have tried a few things, such as WMI, WinRM, schtasks. Each of these options work when dealing with non-interactive scripts. I am trying to call scripts that a) open GUI windows or b) send key strokes to PC2.
Other requirements:
The solution cannot require the password to be type in a prompt nor provided in the command-line call. The desired effect is that I press a button on my keyboard -> ahk command triggers -> script on PC2 is called.
As this network is shared with roommates (and whoever they allow to connect to our wifi), basic security is still a necessity.
This is not a language specific question - I am looking for the simplest/easiest/cleanest method. Thanks for reading.
Try a remote access connection app like TeamViewer. They allow you to control one PC from another across a network. https://www.teamviewer.com/en/
I have an astronomical observatory in my yard with four computers connected to all the observatory equipment. These four computers are controlled over my home network from one PC in the house.
The remote access app allows you to run an .exe on another computer which in my case is usually a compiled AHK script.
I have a number of tasks that require several PC's. A script running on the main PC will start secondary scripts on the observatory PC'c which in turn will send messages back and forth by sending text files to each others shared files. The PC receiving the text file will perform a specific action based on the message.
Here's a link to the observatory startup procedure. I a startup script on the main PC which turns on all the observatory equipment then starts a secondary startup script on each of the observatory PC's to load and position all the software and then connect all the cameras and associated equipment.
https://www.youtube.com/watch?v=UN4VoOKOcXo&feature=youtu.be
This just shows how the various scrips running on the observatory PC's load and position all the various app windows. Not exactly what you may need but it may give you some ideas about what you can do with the remote access software.
Lorence

Win7's debug mode not work on VirtualBox's guest machine

I install Win7 at my virtualbox, setup the guest end a standard "bcdedit"s. (debugtype=serial, port=1, baudrate=115200 /debug=on)
following steps took:
In the host end, I alloc a virtual serial port to the guest system
set the it with named-pipe "\.\pipe\debug".
I start Windbg to connect "\.\pipe\debug", I get "Could not open the pipe Win32 error 0n2"
After I power on the guest machine, I reopen Windbg, it works fine, but just saying "Opend \.\pipe\debug Waiting to reconnect...", It seems that no debugging data communicated with Guest Machine.
I try "bcdedit /bootdebug on", and reboot the machine. this time I see several output by Windbg during booting.
BD: Boot Debugger Initialized Connected to Windows Boot Debugger 7601
x64 target at (Sat Mar 17 17:28:46.559 2018 (UTC + 8:00)), ptr64 TRUE
Kernel Debugger connection established.
************* Path validation summary ************** Response Time (ms) Location Deferred
srvC:\Symbolshttp://msdl.microsoft.com/download/symbols Symbol
search path is:
srvC:\Symbolshttp://msdl.microsoft.com/download/symbols Executable
search path is: ReadVirtual() failed in GetXStateConfiguration()
first read attempt (error == 997. Windows Boot Debugger Kernel Version
7601 UP Free x64 Machine Name: Primary image base =
0x000000000052d000 Loaded module list = 0x00000000005df9e0 System
Uptime: not available Shutdown occurred at (Sat Mar 17 17:28:53.382
2018 (UTC + 8:00))...unloading all symbol tables.
It proves "\.\pipe\debug" is OK to transfer output of Guest VM's COM1.
When entering to login console, I see such message, and previous outputs turn to gray:
************* Path validation summary ************** Response Time (ms) Location Deferred
srvC:\Symbolshttp://msdl.microsoft.com/download/symbols Waiting to
reconnect...
I login and check the Device Manager, I can't find device COM1. but if I turn off /debug, I can.(Indeed, I used putty to check Guest'COM1 with Host's rawfile, I found it worked too, with the input of putty written to Host's file)
I tried many times with different COMs and baudrate, always got same outputs.
I tried a similar VMware Station, and got the same result.
Problem disappeared after I changed a Host machine and redid above steps.(:
Questions:
WHY can't I see the COM1 device with /debug on In the guest machine?
Does the Baudrate matters? (mismatch among Host's windbg setting, Guest's Device setting and Guest's debug setting), I tried to "Cycle BaudRate "In Windbg, it said Net COM port baud is ignored.
How to diagnose the problem?
_EDIT:
I found a similar post stuck on "reconnecting"
and this issue My Kernel Debugger Won’t Connect which refered there was a hot key "Ctrl+Alt+D" to show details of Windbg's I/O instead of a black-box. And it's normal and reasonable that COM1 disappear when "/debug=on" as the post said.
I could see the efforts windbg payed to sync the guest. After I pressed "ctrl+break", I saw windbg said "Send Sync", and still stuck... And, I would going to power off the guest by pressing "Host+Q". Miracle took place. Windbg came to alive and succeeded to break in.
I tried several times, with no failure. Now I can work happily... But WHY???
when I press "Ctrl+break", the windbg says
Send sync break
Send Break in ...
and stuck, and target machine is paused too. And I press "Host+Q" the "Esc" then it works.
install vbox in physical machine (the physical machine is Host henceforth)
install os inside vbox ( the os inside vbox is Target henceforth)
reboot Target and see if things go well a few times
open a elevated command prompt inside Target
since you have not created a Debug BootEntry create one first
run bcdedit /copy /? for syntax
to copy current bootentry to a new one you will be using
bcddedit /copy {current} /d "MyPipeDream"
{current} is alias for the current boot entry ID a GUID
MyPipeDream is a descriptive string
if you reboot now you should get two boot entries to choose from
choose the new bootentry to boot with so that you can operate with {current} well known ID instead of copy pasting or mistyping long unintuitive guids
assuming you booted MyPipeDream
you can check and enable debugging on the current id with
bcdedit /debug {current} on
you should reboot again to MyPipeDream which would be debug enabled now as in screen shots below
but before rebooting set the Serial Interface in vbox settings
also uncheck the connect to existing so that vbox creates the pipe
instead of trying to connect to an existing pipe
all setting on target are over now
on the host create a bat file with contents below and execute it
notice the pipename it is pipedream exactly matching the name we gave in vbox settings and not MyDreamPipe which is the ID descriptive string
start windbg -k com:port=\\.\pipe\pipedream,baud=115200,pipe,reconnect,resets=0
windbg should open up and say witing to reconnect
press ctrl+break a few times in the HOST WINDBG and vbox should connect to windbg or press ctrl+print screen in the TARGET
please see if you require Function keys (some wireless keyboards like logitech
needs ctrl+fn+pause / break key combos instead of plain ctrl+break
else open the Debug menu and select the Break in UI

Resources