Comments (6)
Hi there, sorry, I don't have an Arduino Due so I can't have a look at this. Maybe someone else can help?
from pzem-004t-v30.
Hello, I have the same problem, the problem is as follows:
arduino_due_x/variant.h:251:18: error: 'Serial' has a previous declaration as 'UARTClass Serial'
extern UARTClass Serial;
invalid conversion from 'int' to 'HardwareSerial*' [-fpermissive]
you can see the problem by compiling with the IDE configured on a due card.
Please take a look if you have a few minutes. I want to connect several Pzem on a Due, the mega is not powerful enough for the web interface...
Thank you!
from pzem-004t-v30.
Has anyone found a solution, or work around? Is this issues still relevant?
from pzem-004t-v30.
Hi,
Unfortunately the problem has not been resolved.
Please help to implement compatibility with DUE.
It is very necessary!
Thank you!
from pzem-004t-v30.
This issue might be related to #39 It looks like the workaround for using both hardware and software serial is not completely compatible with all boards. Further investigation is required thought.
from pzem-004t-v30.
Newbie, here. pzem017v1 library (for PZEM-017 DC meter) is identical to pzem004t30 except for specific data addresses. So this should apply. For pzem017v1 DUE compatibility I took inspiration from ModbusMaster library; it uses Stream instead of HardwareSerial; it separates initialization (outside of setup()) from begin() (inside setup). This works...except that oddly I get occasional random read errors (no problem when using ModbusMaster). Still investigating. This is what I did:
In PZEM017v1.cpp replace class initialization and add new begin() member:
//extern HardwareSerial Serial; // Commented out for DUE
/*
PZEM017v1::PZEM017v1(HardwareSerial* port, uint8_t addr) // Commented out for DUE
{
port->begin(PZEM_BAUD_RATE, SERIAL_8N2);
this->_serial = &port;
this->_isSoft = false;
init(addr);
}
*/
PZEM017v1::PZEM017v1(void)
{
}
void PZEM017v1::begin(uint8_t slaveAddr, Stream &serial)
{
_serial = &serial;
init(slaveAddr);
}
In pzem017v1.h:
//PZEM017v1(HardwareSerial* port, uint8_t addr=PZEM_DEFAULT_ADDR);
PZEM017v1(void); // changed for DUE
void begin(uint8_t slaveAddr, Stream &serial); // added
In .ino:
//PZEM017v1 pzem(&Serial3, slaveAddr);
PZEM017v1 pzem;
setup() {
Serial3.begin(9600, SERIAL_8N2);
pzem.begin(slaveAddr, Serial3);
...
I think that's it.
from pzem-004t-v30.
Related Issues (20)
- reset energy, set max power , read alarm flag. HOT 5
- Read Only Current HOT 4
- I can not read 3 pzem HOT 3
- Pzem-004t v3 + Esp32 DEVKITV1 HOT 2
- Mycropyton HOT 1
- HOW TO RESET PZEM004TV3 ESP32? HOT 1
- when I try to upload, I get an error like this: no matching function for call to 'PZEM004Tv30::PZEM004Tv30(int, int) HOT 7
- Seeed Wio LTE
- instantaneous value HOT 1
- Module PZEM-004T-100A-D-P HOT 1
- Issue with Teensy 4.1, using any of the hardware serials (Serial1...Serial8)
- Voltage measurement up to 500 volts HOT 2
- Pzem measuring wrong voltage values HOT 2
- Can you make this code non-blocking? HOT 10
- How to modify this code to only output certain values HOT 6
- is there possible to change the CT (Current Transformer)? HOT 1
- Check if module is connected HOT 2
- Is it possible to send one command to measure to all devices connected instead of sending multiple separated commands? HOT 2
- Issue with 16 current coils muxed together with a single PZEM HOT 1
- Inconsisten Byte order in CRC check sum HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pzem-004t-v30.