No announcement yet.

CAN BUS Shield with ESP8266 WiFi Shield

  • Filter
  • Time
  • Show
Clear All
new posts

  • CAN BUS Shield with ESP8266 WiFi Shield

    Hey Guys,

    I'm having a problem with my 32ptulcd display when it comes to the button presses driving events on the screen.

    My setup includes a Arduino Uno, sparkfun ESP8266 WiFi Shield, sparkfun CAN-BUS Shield, adapter shield rev II, and my 4D display. (Order listed is order stacked)

    I have the WiFi shield using SoftwareSerial esp8266(8, 9) and the display using SoftwareSerial (6, 5). Once I mesh my WiFi sketch with my genie/canbus sketch into my program it doesn't seem to be entering the Genie Event Handler.

    Is there something in my WiFi code that anyone can see that would be causing this communication interference?? Both codes work on their own.. Hell, my genie/canbus sketch works with the WiFi shield stacked on, but the second I mesh the WiFi sketch with it, it doesn't allow the genieEvents to be driven.

    I attached my WiFi code, which seems to be the issue.

    PSA: The Sketch WORKS on it's own. I'm looking for something in it that messes up my other sketch's ability to use the genieEventHandler.
    Attached Files

  • #2
    the problem here is softwareserial, and worst, using 2 instances thereof.
    i suggest 2 options.

    recommended approach, run altsoftserial for an extra serial port and set that for your ESP, then wire your display to pins 0/1 hardware uart.


    run softserial with altserial together, let the display go on altsoftserial and use software serial for the ESP


    • #3
      I've never ran altsoftserial before. How would I set that up, is there an AppNote for it? Also, to have the display on pins 0/1 hardware uart would that just entail running wires from RX/TX on J1&J2 to the RX(0)/TX(1) pins? This is what I did and pressing the winbuttons does enter my event handler, however it does not drive the changes on the display.


      • #4
        ok since you using UNO, you can set the display to 0/1 yes, but if you want to reprogram you need to disconnect as the UNO programs through those pins as well. AltSoftSerial is a library you can download, install in your arduino IDE installation, and load up the example to get an idea of how to activate the 2 pins for a better serial communication port

        if your not running in your loop(), your event handler will never work at all


        • #5
          I have genie.DoEvents() in my main loop(). I put a print statement as my first line under the event handler. The print statement is printing to the serial monitor whenever I press one of the 4 winbuttons I have on my display module. However, in my event handler, I have that when I press one of my 2 win buttons it changes the string and pulls a different color statictext forward, depending on which button is pressed. I am not seeing this occur on my screen.


          • #6
            so it’s partially working? did you check if the objects and their ids match between the display and genie?


            • #7
              i had endless problems until i switched to altsoftserial, it should be a standard plugin for arduino... dedicate the other serial device to rx/tx on the board and buy a USBasp toprogram instead, they only cost 5 bucks. (or the trickier way is to setup your arduino compile and time it.. then hold in the rest button on your arduino, hit upload, and release the rest button just after the compile and before the upload (1 seond window, it takes a few tries), the arduino has a window period that it checks to see if a write is coming from the pc, before it hands over control to the sketch.. but.. trust me, for the aggravation, dont cheap out, just get the USBasp.