I2C Error & Duple COM Port Connection



  • Good evening every one , I use Fipy + Expansion board 3.1

    I'm emulating the transmission of multiple data from a box that contain many sensors by an Arduino that works as a slave I2C device . i tested sending a byte of information from the Arduino as a response to a request from the Master (Fipy) and it worked.

    but when i try to send more than one char (i caste the data to bytes) an I2C bus Error appears !!

    I believe the reason why the Error happens is due to that the Pycom editor is trying to access the Arduino's port ( when i connect it) while it's already connected to the Fipy :

    ![alt text](097e5dee-7815-4efa-a8d4-b8447064133f-image.png image url)

    I'm testing the reception at the Fipy side by the RGB Led while at the Arduino i test the transmission by with the serial monitor ( which shows that the Arduino receives & transmit correctly )

    ![alt text](88ab20d6-7771-4ffd-a781-1eacafedea5b-image.png image url) .

    My Question is how i can control the editor so it only connect to one COM Port no matter how many other devices i connected to the other ports , 2nd for any good suggestions for the I2C Bus Error i'm very grateful .

    PS: I use pull up resistors for the wires .

    Thanks in advances .



  • @Gijs said in I2C Error & Duple COM Port Connection resume examples:

    Hi,

    A basic (flaw / feature) of COM ports is that you are not able to connect to it with multiple programs. When the Arduino software is connected to the port, you are not able to access it using the VScode editor.
    In VScode, you can prevent the Pymakr plugin from trying to connect / autoconnect by clicking all commands in the lower Pymakr toolbar, followed by the 'disconnect'. To solve your issue, you can try to access the fipy using another tool like putty or the Arduino serial terminal. Another way you can try to access the terminal output is through pybytes.

    Hope that solves your issue!

    Gijs

    Thanks for this - much appreciated!


  • Global Moderator

    Hi,

    A basic (flaw / feature) of COM ports is that you are not able to connect to it with multiple programs. When the Arduino software is connected to the port, you are not able to access it using the VScode editor.
    In VScode, you can prevent the Pymakr plugin from trying to connect / autoconnect by clicking all commands in the lower Pymakr toolbar, followed by the 'disconnect'. To solve your issue, you can try to access the fipy using another tool like putty or the Arduino serial terminal. Another way you can try to access the terminal output is through pybytes.

    Hope that solves your issue!

    Gijs


Log in to reply
 

Pycom on Twitter