B4A Library felUsbSerial - Alternative Usb Serial library

Discussion in 'Additional libraries, classes and official updates' started by Erel, Jan 10, 2016.

Thread Status:
Not open for further replies.
  1. Emanuel Straub

    Emanuel Straub Member Licensed User

    Yes, it's only happen when both devices are connected.

    Do i need it when i only want to do a write on it? I'll give it a try.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is possible that the hardware is limited to a single device.
     
  3. Emanuel Straub

    Emanuel Straub Member Licensed User

    I dont know if it is limited to a single device.
    It's working for a few seconds and then application freezes for some seconds.
    After that the application freeze totaly and androids crash and reboots.

    And Some times the application freeze totaly and after i disconnected the usb cable the application recovers.
     
  4. Thuong

    Thuong Member Licensed User

    Thank Erel
    Good job !
    I've done with China's Arduino Nano (chip CH340)
     
  5. Ferraz71

    Ferraz71 Member Licensed User

    Does the library already support the microchip MCP2221 ?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    You can see the list of supported chips in the first post.
     
  7. entolium

    entolium Member Licensed User

    Thank Erel! Great work!

    I'm using with Arduino and works fine, but I have a problem. I send an instruction, and I need to wait for the response.
    If use a "Do while" with Doevents, the "DataAvailable" event don't raise... (?)
    Without the "Do While", the program runs perfect.

    my code is:

    Sub Enviar
    Respuesta=""
    usbserial.Write(bc.StringToBytes(txtEnviar.Text & CRLF,"UTF8"))
    Do While Respuesta=""
    DoEvents
    Loop
    txtRespuesta.Text=Respuesta
    End Sub

    Sub serial_DataAvailable (Buffer() As Byte)
    Respuesta=bc.StringFromBytes(Buffer,"UTF8")
    End Sub


    Any idea?
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
  9. entolium

    entolium Member Licensed User

    Hi Erel,

    I'm not sure where is the best place for this question :confused:.
    The code is very simple, but only works when I don't use the "Do while". I think could be a problem with the library.
     
  10. Erel

    Erel Administrator Staff Member Licensed User

  11. Erel

    Erel Administrator Staff Member Licensed User

    Toley likes this.
  12. red30

    red30 Active Member Licensed User

    Hi!
    I get the array of data:
    Sub fel_DataAvailable (Buffer() As Byte)

    End Sub
    The received array consists of 8 bytes: Buffer(1),Buffer(2), etc. I need to work with each bit of each byte separatly ( f.e. I need to get the 5th bit of the Buffer(1)). How can I do it?
    Thank you for the responce.
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this in the questions forum. This question is not specific to felUsbSerial.
     
    red30 likes this.
  14. red30

    red30 Active Member Licensed User

    Your programme works well but I have a question.
    When I connect to the device and exchange data and take the USB OTG cable out, the app closes with an error.

    Can I write a tost message that "USB cable is taken out" and to relaunch the app automatically?
     
  15. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the error message from the logs?
     
  16. red30

    red30 Active Member Licensed User

    I can not give Logs, since I can not connect wirelessly B4A for debugging ...
    I'm using the USB cable for debug, and since I'm working with otg, I can not connect simultaneously debugging and the device which i am working with

    Tablet RoverPad Sky Glory S7, android 5.1. There is a otg support, a flash card is supported too, a mouse too. But when i try to connect my device UsbDevices.Length = 0. Why?
     
  17. Erel

    Erel Administrator Staff Member Licensed User

    Why can't you connect?

    This means that the OS didn't recognize any connected USB device.
     
  18. red30

    red30 Active Member Licensed User

    The tablet is connected to WF router which is connected to switch which is connected to server. The computer is connected to the server too. I run B4A-bridge and push "Start Wireless" and then in "My IP" my router's IP is written. In B4A i write this adress and push Connect, then write this IP and it replies : Ping failed, TimeOut.
    I cant understand why...
    No, it doesnt recognise only this device, flash cards, mouses etc are ok.
    I install USB host controller from Playmarket and my devise is in the list of otg devices there, so its VID and PID are correct there.
     
  19. Erel

    Erel Administrator Staff Member Licensed User

    red30 likes this.
  20. red30

    red30 Active Member Licensed User

    I did everything as written. On the same device all at once earned (RoverPad Sky Glory S7). In a second (Explay Scream 3G) everything remains the same .. Why?

    Today i got the same error on explay Explay Scream 3G. It reads all otg device, but when i connect my : UsbDevices.Length = 0 . The programm usb host controller also sees my device
     

    Attached Files:

Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice