ksksue / PhysicaloidLibrary

Android Library for communicating with physical-computing boards (e.g.Arduino, mbed)
http://www.physicaloid.com/
354 stars 151 forks source link

Wonder What makes physicaloid.open() fail #36

Open kotran88 opened 5 years ago

kotran88 commented 5 years ago

Hello :) I tested with node mcu(with cp2102) and works quite well. but I made custom pcb with cp2102 and usb-c . when I attach it to my phone, my custom pcb is wired like cp2102's D+ and D- is connected to usb-c 's D+ and D- and cp2102 ' rx tx is connected to mcu's tx,rx

I connect my custom pcb to phone and it detects cp2102 well as code below.

UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
        HashMap<String, UsbDevice> deviceList = manager.getDeviceList();

and I open physicaloid as below

    mPhysicaloid = new Physicaloid(mContext);
    mPhysicaloid.setBaudrate(9600);
    mPhysicaloid.open();

if (mPhysicaloid.isOpened()) { //success //when I tested with node mcu, it always success }else{ //failed //but with my custom pcb with cp2102 and usb-c keep failed. }

I don't get it why mPhysicaloid is not opened...

xxxajk commented 5 years ago

Make sure you are connecting the correct data pair. https://i.stack.imgur.com/Aovh5.png