How to connect to multiple SocketMobile Scanner (CHS 7Mi) at the same time in SPP Mode (C# Windows Forms, Socket ScanAPI SDK 10) - socketscan

Is there a way to connect to multiple scanners at the same time in SPP Mode?
I am using the Socket ScanAPI SDK 10 (the ScanApiHelper class) in a C# Windows Forms Project as host.
I changed the serialport setting from ScanAPI to e.g. SerialPorts=COM3:;COM6: (inbound ports)
But only one scanner connects to the host. If i turn off one scanner the other one connects immediately. But connecting two scanners at the same time does not work. It seems both scanners are communicating over the same com port.
Also it does not work with the official Socket Scan 10 Software from www.socketmobile.com (i tested on Windows 7 and 8.1)

For posterity's sake, here is the complete answer.
The cause
By default, the CHS uses SDP to look for all incoming serial ports, but only attempts to connect to the first one. If the port is busy - i.e. another scanner is already connected - it gives up.
The solution
Caveat emptor: This solution has not been tested on the full range of Bluetooth stacks. It should work, but there may be side-effects. If you experience any, please report them to us.
Your CHS can be configured to try to connect to up to 8 different serial ports on the host device. Instead of quitting after failing to connect to the first serial port, in Scan Mode 1 the CHS will try the next serial port until it either finds a port it can connect to or it has tried all the ports it found using SDP.
1D scanners and 8Qi
Note: If you have a laser scanner, you will need to print out these barcodes to scan them.
Factory reset your scanner
Hover to reveal barcode
Enable SPP mode
Hover to reveal barcode
Enable Scan Mode 1
Hover to reveal barcode
2D scanners (excl. 8Qi)
Factory reset your scanner
Hover to reveal barcode
Enable SPP mode
Hover to reveal barcode
Enable Scan Mode 1
Hover to reveal barcode
Revert
Don't need Scan Mode 1 anymore? Scanning the factory reset barcode for your scanner will clear all settings and put your scanner back in the default mode.

The support from socketmobile told me to scan the barcode for "Scan Mode 1".
Now connecting to multiple scanners at the same time works perfectly

Related

Simulate com port on pc to be recognised by other pc

Currently I have a server, that communicates with a projector through a RS232. The server opens a com port when the projector is connected. The same happens to any PC when a certain type of device is connected through the USB (lets say an Arduino for example). What I want to do it basically replace the projector with a PC/Arduino/Raspberry without the server noticing anything. That would mean the server will recognise the connected PC and open a COM port for it. What do I need to do on the PC so that it automatically opens a com port on the server? I guess there is something very basic that any printer, Arduino, projector etc does, that computers recognise it as a "com port device".
P.S. Doesn't matter the OS on the PC, I just need to make it work and then implement w/e I need to do with the established communication over the port.
P.S.2 I've searched a lot about it, but probabl I am doing it wrong, because I didn't find my type of question anywhere.
COM ports are basically hardware that is detected by the system. Let's say, if an Arduino is connected to a PC, it has its onboard USB to TTL converter which can be found in the device manager(if using windows). Similar USB to TTL converters are there in the market like CP2102, PL2303 which acts like a COM port even if no device is connected further to it. it may be possible that the program you are using(as you referred server) may be sending some data over the serial port and verifying the hardware.
What you need to do to replace it is, first of all, find the baud rate at which the communication is going on, then, listen over the serial lines which machine is sending which message in the sequence(there must be a handshake as I mentioned earlier), if a complicated algorithm is not used by the device, you can simply mimic the device by sending same messages over serial.

How to fix slow scan rate in SocketMobile Scanner 7Ci?

We've been using the socket scanner in our warehouse for scanning inventory items. We have an iPad application which connects to Socket Scanner to read data off barcodes.
Off late, the scanner is taking a long time to scan. The very first scan completes quickly as expected, but the subsequent scans take a long time ( usually 7-8 seconds). We restarted the scanner, unpaired and re-paired the scanner, did a factory reset, but the issue persists.
Socket Scanner Model: Socket Mobile 7Ci
Host Operating System: iOS 10.3.2
Is there any way to know what might be affecting the scan rate?
Also,
Please check the video which explains the issue in detail:
https://www.dropbox.com/s/dyzj5t7vseunw1y/VID-20170916-WA0001.mp4?dl=0
Apparently, when we did the Factory Reset, the Bluetooth on the iPad was ON and the scanner was connected. It beeped, but actually did not do a Factory Reset.
Looks like scanning Factory Rest Barcode is effective only when Bluetooth is off in the device ( And scanner disconnected from iPad). We switched off Bluetooth in the iPad and scanned the Factory Reset Barcode. The scanner played a music tone and switched itself off. When we powered it on scanned barcodes, there was no delay at all.
The trick is to do a Factory Reset of the device the right away.
Link for SocketMobile Manual:
http://www.socketmobile.com/docs/default-source/series-7/chs-1d-imager-user%27s-guide.pdf

Espressif Wifi not connecting or showing AP

First of all, I won't go into details, cause there are a lot of them, and I dont want to write (a too long) essay. There is TL;DR section at the end, because I have a specific question, but maybe some additional info can help.
I have a device that is made of a GRU (glass room unit) and espressif (esp8266).
GRU and esp8266 communicate via serial, with GRU as master. GRU is programmed with an internal tool, and I can monitor everything on it, including the info it gets from esp8266.
There is a test/development device, that has espressif on top of the GRU, so I can easily take it off, reprogram/reconfigure it, and put it on.
Espressif is inside of a GRU, and downloading stuff to flash is a real pain. There is whole process including a OS switch (from Win7 to Linux and back). Console output on espressif cannot be done, or at least not in the time frame I have.
For esp8266 I use non-os SDK V2.0.0_16_08_10.
Espressif can be configured with downloading a configuration to flash, or via UDP (over a network if connected, over its AP if its not connected).
Algorithm for Wifi:
1. Try to connect to a network from configuration
2. If it succeeds, raise a flag for that
3. If it fails, enter dual (STATION+AP) mode and raise a flag for that
The reason espressif is not always in dual mode is that it affects multi-cast operations.
Configuration over network is done by a Java aplication I wrote.
Scenario 1
I've configured a wifi router, configured all (x19) of the devices (espressif in devices that is) to connect to its network. When I turned them on, they would connect one by one. The ones that didn't entered dual mode and could be configured via the app.
All well.
Scenario 2
I've wanted to test the system in real world, so I reconfigured them to connect to the our firms network. Additionally when I was already going thru the whole process I've downloaded latest firmare to flash.
I expected that they would connect or enter dual mode and create their own APs. But they did not.
I tested then the code and configuration on espressif whose console output I could monitor, and everything worked.
I tested then the code and configuration on the test device, and it worked again.
I've then redownloaded the code and configuration to one device, and it didn't work.
TL;DR
I have two devices, espressif on a GRU and espressif inside of a GRU. Both connected to one network. Esp on a GRU work for another, Esp inside of a GRU doesn't work for that other network.
They have identical code and configuration, so it shouldn't be a software issue.
Does having espressif inside of a device jams its signal enough that it can't go trough? Device is not big (5x5x2cm).
UPDATE 1:
While I was writing, the espressif inside of a GRU managed to connect to network. I then restarted it so I can check that it can do it again, and it can't connect again.
It took me about 10 minutes to write the whole question.
There are two things that seem to have caused the problem.
When I removed gpio_init(), network stuff became faster, much much faster. Everything on it, connecting to AP, creating AP etc...
I've changed my config and wifi code, so that it now stores the ap and station config to flash via API.
I only check if its internal config is the same as mine from flash. If it isn't, it saves it. Now, I only control the current opmode.

Serial Port not working on Surface Book

I have a Microsoft Surface Book that I've dual booted Linux Mint on. I'm writing a program that needs to read in data from a serial port, but my serial ports don't seem to be working. The behavior is consistent across Mint and Windows (Testing done through Cygwin). It gets a bit of data the first 2-5 seconds that the device is plugged in (viewing the data through screen, same thing happens if I just use pyserial to print data incoming from serial port), then nothing.
What could be happening? I think I've isolated the problem to the serial ports - the Surface Book has 2 USB ports and the same thing happens on both of them, and I've tested the hardware that I'm plugging into it on 2 other computers (One Linux and one Mac OS), and it works fine on both of those.
Your MS Surface, seemingly, has a yellow triangle exclamation mark icon (over the adapter icon) without any driver to install/download. And properties in the device status box window say This device cannot start. (Code 10) or A device which does not exist was specified. Right?
If it's so you should wait for an update from MS. It's notorious problem.
I ended up getting the computer replaced on warranty for an unrelated issue months later, and what do you know, on the new computer the serial ports work fine. That indicates to me some sort of hardware problem, given that the issue persisted across OS's.
maybe this will help:
see Arduino examples for serial port communication - search google:
arduino serial c++
arduino serial c#
arduino serial c++ linux
the point is to open port properly you need to open a file, not a port. not with usual c - assembly write to port code.
another option you are using an unintentionally bought fake USB to serial cable with a Fake PL2303 chip
then you need to install the old version of the driver.
search in google:
Fake PL2303 + your os name:
install driver Fake PL2303 windows 10
another option is maybe it conserves energy and closes the port because it feels it is unused.
in windows> device manager,> properties of a device - usually USB root hub > power management - allow the computer to turn off this device to save power - uncheck it.
https://superuser.com/questions/408683/why-my-usb-mouse-gets-suspended-after-3-seconds-of-inactivity
https://blogs.msdn.microsoft.com/usbcoreblog/2013/11/08/help-after-installing-windows-8-1-my-usb-device-doesnt-charge-or-it-disconnects-and-reconnects-frequently/
also, you could look in windows events - to see what happens. usually, failures like this are registered in the events log.
an unlikely option is it consumes too much current, like a short circuit. and the device protection circuit shuts the chip off. also probably it does not have such circuit. one possibility is to try with an external powered hub.
the most probable of these is the power saving mechanism
I was experiencing the same problem - came across the solution on another site. The USB 3 ports on Surface Book aren't compatible with something or other to do with Com Port but running the device through a cheap USB hub solved my problem straight away and it was instantly recognised by the Arduino IDE

Communicating with serial device over multi-drop bus

I'm new to serial communication. For a project I have to develop software for a vending machine. The vending machine basically consists of a host computer (a windows xp machine) and various peripherals. One of those peripherals is a coin acceptor. According to the documentation of the vending machine, the host computer communicates with the coin acceptor using the serial port. The only documentation I have is this document called "Multi-Drop Bus / Internal Communication Protocol" (the version I have can be found here: http://www.coin-acceptor.com.cn/Upload/EditorFiles/technicalfile/Mdb_version_4-2.pdf).
According to the docs it seems I have to create a serial port connection using a baud rate of 9600, 1 start bit, 1 stop bit, 1 mode bit and 8 data bits (page 29 in the linked document). The vending machine docs state that the coin acceptor is on COM port 6. I tried to create a connection like this using HyperTerminal and Putty. My first question is:
How do I properly create a connection to a device that supports this MDB 'protocol'? Putty and HyperTerminal don't allow me to set a "mode bit". I didn't find anything about the flow control and parity bit in the document. Can this be done using Putty or HyperTerminal? Or do I need some other tool to communicate over MDB?
My second question is about how to send a command to the device. I looked through the commands and saw a RESET command. According to the document, upon receiving the RESET command the device should reset itself and respond with an ACK. According to pages 33 and 63 of the document, if I want to send the RESET command to the coin acceptor, I can send the HEX value 08H over the serial line. Page 33 states that the coin changer listens to commands sent to addresses 08H until 10H (if I'm interpreting the document correctly, that is). Page 63 states that the RESET command is 08H with no data bytes. So can I just type "08H" into Putty and hit "enter" to send this command to the device? Or how can I send this command to the device over the serial line? Is this even the right approach or am I looking in the completely wrong place? The vending machine docs only contain this document for the coin acceptor. Thank you for the help!
Kind regards
Chris

Resources