Hello
Sorry, I could not find similar topic for my problem, so create a new one.
I am trying to transfer an image from Camera to NodeMCU but the lenght of the received data is not as same as the size of the image I get from :
ax.size();
the code in OpenMV IDE is:
import time
from pyb import UART
uart = UART(3, 500000)
uart.init(500000, bits=8 , parity=None , stop=1)
import sensor, image, time, struct
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
quality = 50;
for i in range(1):
clock.tick()
img = sensor.snapshot()
ax=img.compress(quality= int(quality))
print(ax.size() , clock.fps())
uart.write(struct.pack("<l", ax.size()))
uart.write(ax)
and NodeMCU code for reading is:
#include <SPI.h>
#include <SD.h>
// Define Slave Select pin
#define SD_CS 53
byte tempread;
void setup(){
Serial.begin(500000);
}
void loop(){
if (Serial.available()){
tempread = Serial.read();
Serial.println(tempread);
}
}
For instance, on both OpenMV and NodeMCU IDE I get 1487 as the size of the image but I just received 628 bytes as the image data.
Any help is highly appreciated.