Serial usb connection

Hi can anyone help with creating an extension for serial usb?

did you already try the Arduino USB Serial Extension by Pavitra?
see also the extensions directory here https://puravidaapps.com/extensions.php

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

1 Like

Hi i tried but it doesn’t connect to the usb , no popup, maybe the app needs permission?
Im testing with his example app.
Thanks

you might want to ask the developer of the extension @pavi2410
Taifun

1 Like

Today, this extension or similar is added to components ai2. Does anyone know how to use this component? Need I an external usb-uart converter eg cp2102? Is this component only for arduino or does it work with other uart devices?

I tried it on other device, not arduino, it didnt recognize the device connection
:frowning_face:

1 Like

I’ve tried using it as well. I didn’t get very far. If anyone has any documentation, please let us know. Thanks a bunch !

Maybe add a \n to the end of the AT command?

1 Like

Thanks Il try.
It didn’t work, the app doesn’t recognize the
Connection and don’t react to OpenSerial.
Other apps that i tried in google play
Work straight away no configuration needed,
Every time I connect the usb a popup appear and i give the permission to connect to the serial USB

Maybe there are other parameters your device needs that AI2 doesn’t provide…

What device are you using? Is there a developer guide for it?

The model is
pci-e 910 telit dw5580
Im communicating with it by AT COMMANDS

This looks like some sort of PCIe LTE card. How are you connecting it to your Android device?

(It also might help to connect your Android device to the computer, run adb logcat, and post the results here. If you don’t have adb, get it here: https://developer.android.com/studio/releases/platform-tools)


You can see that the power is on
The problem is that the app doesn’t recognize serial usb connection

I found a great intro and bibliography for serial USB at https://en.wikibooks.org/wiki/Serial_Programming/USB

1 Like

Since the doc link on the extension at http://extensiondirectory.com/tools/arduino-extension.html asks for the phone to be set for USB media Transfer Protocol, and because the source code has references to file operations, there is a possibility that the data transfer is meant to work one file at a time. Since there are no mentions of file names in the blocks, the simplest case I can think of would be an instream text file. Since text files typically are terminated with hex zero in C, maybe it would be helpful to have some way of adding one to the end of a data stream. Here are some blocks (draggable) to generate a x’00’ character…
hexify HexZero HexZero_test hexZero_test_call

Someone added a random extension to Appinventor and no one knows how to use it :smiley:

It is documented as an A2I component. See: http://ai2.appinventor.mit.edu/reference/components/connectivity.html#Serial

There seem to be a couple of problems though with this component:
1> The read, write, print only handle "text". So there may be a need to "program" around this short-coming if you are receiving/transmitting high/lows/ binary1/0, and hexadecimal characters formed in packets . Ah the challenge.

2> If you are using the OTG port on the Android or Emulator it is difficult to run a client USB device and upload APK's. Patience, patience.

What has been done so far:
The Arduino USB Serial Extension kind-of-worked until it was challenged a bit. The the JAIL compiler "burped" and crashed. So a search was started for alternate solutions. The OTG USB Bridge was found to be highly suspect and unusable.

If you try the Serial.aia, try "enabling" the Textbox entry object and the Button adjacent to it. The enabled Button will "send" a text string message somewhere. As of yet no client device has acknowledge receipt of a transmission from the enabled Button.

The saga continues.

GTKTerm-Receiving Inputs from F310 Gamepad
p054_gtkterm

I don't know if this helps you (or anyone), but I can confirm that the serial component in AI2 does work with an arduino device using an OTG cable. I am able to initialize and open a connection and then send information to the arduino to blink LEDs (HIGH/LOW), etc.

In terms of information transmitted, the arduino (and probably other devices) can convert ascii data into hex/binary/etc upon receiving or before transmission. Not sure about your gamepad if you can't program it.

Re: USB cable occupied, my workflow for this stuff is:

  1. From app inventor, build app to QR code.
  2. Copy the link (it's always the same except for four characters) and download on phone browser and install.
  3. To update, delete app and repeat. USB cable remains attached to serial device.

See this thread for a working .aia:
https://community.appinventor.mit.edu/t/usb-permission-popup-every-time-serial-component/12596

I can provide you with a sample arduino sketch if it interests you, but it seems like you're working with other hardware.

I have not worked with receiving data from serial device yet, only transmitting.

1 Like

Ditto on the TX and confirmed on the RC. But the Extension falls apart if Arduino (mega256) is replaced with a F310. I am looking under the hood to see if a device specific extension for the F310 is required. At the moment it seems so.

My backup plan is to use a "spare" Arduino Uno with a joystick component for direction and a potentiometer for speed control instead of the F310.

same here: the serial extension works fine with arduino MEGA 2560 (RX and TX)
but not with Arduino UNO nor Teensy LC :frowning: