TTY port

87 просмотров
Перейти к первому непрочитанному сообщению

Fernando Muñoz

не прочитано,
18 июн. 2019 г., 07:20:3918.06.2019
– MIT App Inventor Forum
Hi
is it possible to send data to the port /dev/ttyMT2 in MIT App inventor?
Many thanks

Chris Ward

не прочитано,
18 июн. 2019 г., 08:52:2318.06.2019
– MIT App Inventor Forum
Hi Fernando

Is that Port a physical port or virtual? What is it in relation to? How is it connected?
Jean-Rodolphe Letertre created a TCP Extension, that might be of use:
See my website to download:



Fernando Muñoz

не прочитано,
18 июн. 2019 г., 09:01:2218.06.2019
– MIT App Inventor Forum
Hi Chris,
thanks for your answer. It is a physical port, it is a printer in a android terminal.

Chris Ward

не прочитано,
18 июн. 2019 г., 10:47:0418.06.2019
– MIT App Inventor Forum
OK - depending on your Android version, the Android Device (phone) should offer a print function, via a printer plugin if necessary.

Are you trying to send media (text/images) for printing or ?
Are you connecting to the printer via USB cable or ?


Сообщение удалено

Fernando Muñoz

не прочитано,
18 июн. 2019 г., 10:54:1718.06.2019
– MIT App Inventor Forum
Hi Chris
printer is intergarted into de terminal, in the printer doc we have to send text to /dev/ttyMT2 device. Teh terminal is the MG-9300 of uwinscan.
If i can to send image it would be great too

Chris Ward

не прочитано,
18 июн. 2019 г., 11:08:3018.06.2019
– MIT App Inventor Forum
Hi

Can you post a link to it on the Manufacturer's website?
Сообщение удалено

Fernando Muñoz

не прочитано,
18 июн. 2019 г., 11:31:3618.06.2019
– MIT App Inventor Forum
Hi
i can't do it, i can't to write the link
uwinscan com

Chris Ward

не прочитано,
18 июн. 2019 г., 16:02:5618.06.2019
– MIT App Inventor Forum
Hi Fernando

This one?

MG-U9300 print integrated smart handheld terminal
1. ARM Cortex-A53 64-bit quad-core processor (1.3GHz);
2. Android7.0 operating system;
3. 16GB eMMC/2GB DDR3;
4. 5.0-inch IPS color display with a resolution of 720×1280;
5. 3.7V, 4800mAh battery;
6. 1D/2D barcode scanning, 58mm thermal printing, fingerprint reader;
7. WIFI, BT4.0, NFC

2018-10-29-18-26-16.jpg


Chris Ward

не прочитано,
18 июн. 2019 г., 18:28:1618.06.2019
– MIT App Inventor Forum
Hi Fernando

The manufacturer is Shanghai Basewin Technology.

I don't fancy our chances of printing via the tty port - this is supported via the uwinscan SDK (Software Development Kit) and generally that can only be incorporated into text-based code. That said, it should therefore be possible to write an App Inventor extension and sample code for a demo App is provided.

uwinscan supply a ready-to go-tty demo App  - have you tried it?

Incase there is another way, I have asked the supplier via email. Awaiting their response.

ABG

не прочитано,
18 июн. 2019 г., 18:29:3518.06.2019
– MIT App Inventor Forum
The site has no software documentation on the device.

Here's an easy experiment to try with the device, if you have one,
based on the idea that Android is descended from unix and
unix devices respond to file names and file operations .

Pull in a File component, and write this text to file
'/dev/ttyMT2' : 'Hello World\r\n'

and see if it prints anything.

I give it only a 1 in 4 chance of working, but it's an easy test.

ABG

Chris Ward

не прочитано,
18 июн. 2019 г., 18:42:4018.06.2019
– mitappinv...@googlegroups.com
....perhaps we could do something via Activity Starter?

ActivityStarterSend.png


SendDataToTtyPort.aia

Chris Ward

не прочитано,
18 июн. 2019 г., 18:47:2418.06.2019
– MIT App Inventor Forum
Hi Fernando

in the printer doc we have to send text to /dev/ttyMT2 device

Is that document a PDF or similar? Can you attach it to your forum post?

AttachDocumentToForumPost.png



 

ABG

не прочитано,
19 июн. 2019 г., 10:33:0419.06.2019
– MIT App Inventor Forum
Here's another idea for how to send text to /dev/ttyMT2 ...
Use one of the shell extensions for AI2, and issue a command
to copy text via the shell, using either the cat command or the echo command...

echo 'Hello World\r\n' >> /dev/ttyMT2

or

cat MyText.txt >>  /dev/ttyMT2

ABG

Fernando Muñoz

не прочитано,
20 июн. 2019 г., 02:52:3720.06.2019
– MIT App Inventor Forum
Hi
here the printer document i have
Thanks
PortablePrinter Development Guide.pdf

Fernando Muñoz

не прочитано,
20 июн. 2019 г., 05:40:3520.06.2019
– MIT App Inventor Forum
Hi
Chris activity starter doesn' work
uppsss

Fernando Muñoz

не прочитано,
20 июн. 2019 г., 06:04:2820.06.2019
– MIT App Inventor Forum
Hi ABG
with terminal extension it doesn't work

ABG

не прочитано,
20 июн. 2019 г., 08:29:5820.06.2019
– MIT App Inventor Forum
Your development guide pdf is for Java programmers.

For help developing an AI2 extension, see the
Extensions section of FAQ
and also see the Open Source forum in the Forums section
of that FAQ.

ABG

ABG

не прочитано,
20 июн. 2019 г., 09:26:0720.06.2019
– MIT App Inventor Forum
Here's another lazy idea to try ...

There's a Sharing component in AI2 you can use to pass
a text file to another app, like maybe a dedicated printer app
if you are lucky.

You would write a little text file from your app,
then share it with the printer app.

I haven't used that yet, and I am not sure if Android 
can link file name suffixes like .prn or .txt to specific apps
to make this choice automatic.

ABG

Chris Ward

не прочитано,
20 июн. 2019 г., 10:59:1220.06.2019
– MIT App Inventor Forum
@ ABG, Fernando. The sharing of files has a file path issue unfortunately. MIT is aware. Not impossible to use it as-is, but close to impossible.

Chris Ward

не прочитано,
20 июн. 2019 г., 11:01:0520.06.2019
– MIT App Inventor Forum
Hi Fernando

For the Activity Starter - what did you try? If you build it as an APK and install on the device, if it fails we should at least get a useful error message.
Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений