Notecard with M5UnitCam V2

Hi All,

I’m trying to connect my notecard with M5Unit Cam V2, I’m using this below script to communicate with Notecard in Unitcam V2’s Jypyter notebook.

Input:

import json
import notecard
import serial
import time

productUID = "com.[your-company].[your-product]"

serial = serial.Serial('/dev/ttyS1', 115200,timeout=1)
card = notecard.OpenSerial(serial, debug=True)

req = {"req": "hub.set"}
req["product"] = productUID
req["mode"] = "continuous"
card.Transaction(req)

while True:

    temp = 10
    humidity = 20

    print('Temperature: {} degrees C'.format(temp))
    print('Humidity: {}%'.format(humidity))

    req = {"req": "note.add"}
    req["file"] = "sensors.qo"
    req["start"] = True
    req["body"] = {"temp": temp, "humidity": humidity}
    card.Transaction(req)

    time.sleep(15)

Output Response:

And this empty file was created.
image

Wiring Connection:
NoteCard | UnitCam V2
1.TX ------------>RX
2.RX------------->TX

Reference Link: m5-docs
Here is the serial communication example for UnitCam V2.

Hi @Pradeep ,

First, I’m not super familiar with Python, so forgive me if I’m overlooking something obvious…

If I’m reading the stack trace correctly, it is simply suggesting that the Notecard is unresponsive.

You reported the following connection between the Notecard and the M5UnitCam V2:

Wiring Connection:
NoteCard | UnitCam V2
1.TX ------------>RX
2.RX------------->TX

In order for the Notecard, or any device, to interpret logic-level signals there must be a common ground between the two devices. So in this case, your hardware connection should require 3 wires as follows:

Wiring Connection:
NoteCard | UnitCam V2
1.TX ------------>RX
2.RX------------->TX
3.GND---------->GND

If you already have a common ground, but forgot to mention it, please let us know, so we can continue to explore your problem.

Best,
Zak

Hi @zfields ,

Thanks for the response, actually im powering up the note card with the Unitcam V2, and i have a GND connection between them.

Regards,
Pradeep S.

Okay, that’s good. I had to ask just to make sure.

Do you have an oscilloscope or any other UART based peripheral, so we can confirm you are seeing UART activity using the serial communication example (without the Notecard present)?

~Zak

Hi @zfields ,

Unfortunately, I don’t have an instrument, but I tried to communicate the V2 with Wio Terminal via UART. Wio Terminal can receive the data which I send from the V2.

I made some changes in code also.

Serial Monitor Results:

Notehub Response:

Here is the detailed video: Notecard_V2_Issue.mp4 - Google Drive

What are the operating and logic level voltages for the M5UnitCam V2?

The UART port gives me 5V power out. Sadly there is no info about logic levels.

im powering up the note card with the Unitcam V2

Are you using the Grove port to supply the Notecard’s power and ground, or something else?
Which Notecarrier are you using?
What input are you using to power the Notecard, V+?
Lastly, can you send a picture of your setup?

1. Are you using the Grove port to supply the Notecard’s power and ground, or something else?
— Yes, I’m using V2’s grove port to power up the notecard.

2. Which Notecarrier are you using?
— Notecarrier A

3. What input are you using to power the Notecard, V+ ?
— Yes, V+ of the Notecard. (which is connected to +5V to UART grove)

4. Can you send a picture of your setup?

Hope this helps.

Hi @Pradeep,

We have looked at your pics, read the available technical information for the M5Stack UnitV2, and we are concerned you may be overextending your power budget.

If you have a LiPo battery available, we would like for you to do a quick test and connect it to the Notecarrier-A and see if it resolves the issue. This would ensure there is enough power available to the system.

If it works, then we understand the problem. If not, then we can rule it out and pursue other potential problems.

~Zak

Hi @zfields ,

Unfortunately, at this moment I don’t have the +5 V battery, so I just plug the USB on Notecarried and remove the V+ connection between Notecarrier and V2. But still I’m hitting the same issue.
Actually, I’m using Jupyter Notebook to do this development.

This is from the Notecard Py library example:

Error Log:

And I tried without the Notecard Lib by using this code, but no response in the notehub.

Notehub Response:

Connection Image:

Hi @Pradeep,

For a quick sanity check, you are able to connect your computer to the Notecarrier-A and issue those commands directly*, correct?

/* Using either the web-terminal (dev.blues.io) or a terminal application like CoolTerm or GTKTerm

Hi @zfields ,

By that way it’s working fine. Also it’s works with notecard python lib in my pc.