OpenMV and NodeMCU cant work together

Discussion related to "under the hood" OpenMV topics.
duyci
Posts: 6
Joined: Wed Feb 27, 2019 4:33 am

OpenMV and NodeMCU cant work together

Postby duyci » Wed Jun 05, 2019 2:51 pm

When I try to send character OpenMV to NodeMCU wifi module under the UART communication.But I failed.

Firstly this is my NodeMCU side codes:
When the serial communication avalible I have to see read_data

Code: Select all

void setup() {
  Serial.begin(115200);     // Initialize the Serial interface with baud rate of 9600
}
 
// the loop function runs over and over again forever
void loop() {  
  if(Serial.available()>0)    //Checks is there any data in buffer 
  {
    Serial.print("We got:");
    Serial.print(char(Serial.read()));  //Read serial data byte and send back to serial monitor
  }
  else
  {
    Serial.println("Hello World..."); //Print Hello word every one second
    delay(1000);                      // Wait for a second
  }
}
When I connect to NodeMCU rx,tx pin to OpenMV P5 and P4 pins. Than when I just connect NodeMCU with usb cable to computer and upload code. And open terminal I can see "hello word" thats okey. But at the same time when I connect OpenMV with the usb cable to computer. I can not see anything but my openmv side send some cha character to nodemcu bu i can not see anything.

Where is my fault. Please help me ?

This is openmv side code:

Code: Select all

import pyb
import sensor, image, time
# openMV standart settings:
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
sensor.set_auto_gain(False) # must turn this off to prevent image washout...

clock = time.clock()
[code]#uart initilazing P4:TX and P5:RX
uart = pyb.UART(3, 115200, timeout_char = 1000)
#tracking qr code and send to uart
while(True):
    clock.tick()
    img = sensor.snapshot()
    img.lens_corr(1.8) # strength of 1.8 is good for the 2.8mm lens.
    for code in img.find_qrcodes():
        img.draw_rectangle(code.rect(), color = (255, 0, 0))
        print(code.payload())
        uart.write('h')
        print(uart.read())
    print(clock.fps())

[/code]
User avatar
iabdalkader
Posts: 1142
Joined: Sun May 24, 2015 3:53 pm

Re: OpenMV and NodeMCU cant work together

Postby iabdalkader » Wed Jun 05, 2019 3:29 pm

I don't understand you, can you try to explain it again ? Also a picture of the wiring would help.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests