Solution for the box that was connected to a USB printer
B4X:
public Sub OpenCaja
Try
'this line was the key
printString = printString & Chr(27)& Chr(112)& Chr(0)& Chr(50)& Chr(250)
jo.RunMethod("printString",Array(printerGen,printString))
Dim by() As Byte = jo.RunMethodjo("cut",Null)
jo.RunMethod("printBytes",Array(printerGen,by))
Catch
CallSubDelayed(Main,"ErrorPrint")
Log(LastException)
End Try
End Sub
I somehow missed your original query, through not realising that "money box" was "cash drawer", otherwise I would have immediately posted this guy's most excellent page aka global internet source for information about opening cash drawers.
Serial devices are the bane of human existence and will undoubtedly be responsible for the extinction of all life on earth. Accessing the serial port is an iffy proposition at best and in many cases will not work at all.
Top Bloke
His list of control codes for opening cash register drawers is on the pages:
I apologise re: being too late to be of use to you, but figured I'd post the link anyway because the next B4A programmer faced with a cash register printer/drawer is no doubt going to find this thread.