Start a new topic

Intel Edison Arduino Board + Nextion LCD

I bought a 4.3' inch NX4827T043 Nextion touchscreen display for my project. I'm going to use this lcd to communicate with sensors and the microcontroller i prefer is Edison Board. Fyi, i'm quite new in programming. Getting started with this lcd, i use Arduino IDE to compile the sample sketch "CompButton_v0_32" from ITEADLIB_Arduino_Nextion-master library however i get the error  'itoa' was not declared in this scope. Someone give me an advice to modify itoa function in the stdlib.h. Does anyone here success to compile the skecth after modifying the code?  


If i use nextion-master library from another author i get the error SoftwareSerial.h: No such file or directory. From intel forum, i get to know that SoftwareSerial library is not compatible with Edison board as the architecture of Edison is x86. 


I read a thread 'Multiple 0xFF returned after every transmission' from this forum and found out that Andrew use mraa library to transmit data through UART. And Patrick Martin, he mentioned he use kylix.


I have lost. Could anyone please guide me how to make my Nextion lcd working with Edison board. At least, where should i start?


Start with the Edison and Arduino board for Edison documentation.

The Arduino Edison has a least one UART exposed. 

   - use that RX/TX pair to connect Nextion to.

Check your board's documentation to ensure it can power the 4.3"

and if it is questionable - use a clean 5V 1A supply for Nextion.

Ensure GND is common on both the Nextion and the Edison.


Look into the Arduino of Things which supports Arduino on Edsion

 - Intel's support of how to code does not expand into Arduino


Then write your Arduino style sketch, It should have something like

    Serial.print("t0.txt=\"Hello\"ÿÿÿ);

     - changes HMI t0.txt on Nextion to "Hello"


But read the documentation, and re-read it again.

 - not being sure is not an excuse when it fries.


Nextion help (as in designing Nextion HMIs) is here, this forum.

Intel help is in the Edison forums - the guys are good over there

Arduino help is on the Arduino forums.


Coding help depends on what you are coding with ..

  - Arduino C++ ... the Arduino forums

The Edison comes with gcc and python already installed


As Edison is a dual core 500MHz Linux - it's basically a server,

 - I chose to Install my licensed Kylix3 Enterprise Edition

 - support for Kylix3 Pascal

    ... well Borland doesn't support it after they sold it out long ago

But I chose to use Kylix3 so that my code is not open-source.


But as it is a Linux flavour on an Intel platform ...

  - there are hundreds of programming languages to choose from

It is a development platform, so hacking skills were almost expected.


If just learning to program, I recommend Arduino of Things

This allows basic sketches in Arduino C++ to run

And I recommend reading the documentation, and re-reading again.

When you've started to master sketches in Arduino C++

   there is a whole Linux world of capabilities to explore with Edison

Edison is indeed a power house, 4GB space, 1GB sram, Wifi, Bluetooth


There is much documentation for the Arduino Edison

  and then there is documentation for all its Linux parts most of which is Open Source,

  and most Open Source documentation is included in the source code files

  or man pages, or the readme files, or in books written about the package.

But I would start with all the Official Documentation over at Intel

   and start with sensors they identify as known to work well with Edison.


1 person likes this

I have study some documentation such as edison hardware guide, release note, shield testing report, nextion instructions and so on but i still can't figure out how to solve the issue. The software serial can be substituted with hardware serial. But how about itoa or atoi issue?? Is there any alternative function to change integer to ASCII? Please give me some hints. Thank you in advance !

itoa and atoi is part of some library that you haven't included - thus not in scope

find which library, include that library, and function itoa is now available in scope

   But itoa and atoi will indeed be a basic function of some core library

       libc, SysUtils, System, Arduino.h,

   can also be under different names StrtoInt/InttoStr,

       which depends on language/compiler

These are programming type conversions - language/compiler documentation


First, did you include Arduino.h in your code?

   #include <Arduino.h>


Second, what is itoa and atoi?

   itoa is integer to ascii, a uint32_t or the likes to its written ascii form

   atoi is reverse, ascii written form to 8-bit, 16-bit, or 32-bit form


Algorithm for itoa goes something like

    while i > 0 do         // do until all digits are done

      begin                    

         m := i mod 10;           // m is i modulo 10 a digit

         s := chr(m+48) + s;   // byte(digit + 48) renders char ascii of digit stored in string s

         i := i div 10;               //  i div 10 clears and sets up for next digit. 

      end;                             // ends with i = 0, all digits processed


Algorithm for atoi goes something like

   i := 0;

   for x := 1 to length(s) do  // where s is string holding text number

      i := i * 10 + (ord(s[x]) - 48);


So programming is unlikely in an MCU hardware documentation (highly doubtful)

And most likely in the compiler reference / language guides



1 person likes this

Yes. I did include the Arduino.h into the coding as shown below:


#include "Nextion.h"

#include <Arduino.h>

#include "itoa.h"

#include "stdlib.h"

 

void setup() {

 

NexButton b0 = NexButton(0, 1, "b0");

char buffer[100] = {0};

 

NexTouch *nex_listen_list[] =

{

    &b0,

    NULL

};

void setup (void)

{

nextInit();

b0.attachPop(b0PopCallback,&b0);

dbSerialPrintln("setup done");

}

void loop(void) {

  nextLoop(nex_listen_list);

}


And i get error as follow:


Arduino: 1.6.9 (Windows 8.1), Board: "Intel® Edison"


C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint16_t NexButton::getText(char*, uint16_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:29:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::setText(const char*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:40:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::Get_background_color_bco(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:51:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::Set_background_color_bco(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:60:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:64:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:69:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::Get_press_background_color_bco2(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:79:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::Set_press_background_color_bco2(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:88:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:92:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:97:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::Get_font_color_pco(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:107:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::Set_font_color_pco(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:116:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:120:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:125:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::Get_press_font_color_pco2(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:135:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::Set_press_font_color_pco2(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:144:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:148:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:153:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::Get_place_xcen(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:163:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::Set_place_xcen(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:172:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:176:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:181:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::Get_place_ycen(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:191:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::Set_place_ycen(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:200:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:204:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:209:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::getFont(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:219:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::setFont(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:228:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:232:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:237:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::Get_background_cropi_picc(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:247:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::Set_background_crop_picc(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:256:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:260:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:265:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::Get_press_background_crop_picc2(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:275:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::Set_press_background_crop_picc2(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:284:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:288:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:293:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::Get_background_image_pic(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:303:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::Set_background_image_pic(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:312:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:316:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:321:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint32_t NexButton::Get_press_background_image_pic2(uint32_t*)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:331:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'bool NexButton::Set_press_background_image_pic2(uint32_t)':

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:340:25: error: 'utoa' was not declared in this scope

 

     utoa(number, buf, 10);

 

                         ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:344:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:349:21: error: 'class String' has no member named 'c_str'

 

     sendCommand(cmd.c_str());

 

                     ^

 

exit status 1

Error compiling for board Intel® Edison.

 

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.


My question is whether the Nextion LCD really supports Intel Edison Arduino Kit on Arduino IDE? Did you try any testing before? By integrate Nextion LCD with Edison Arduino Kit and compiling using the Arduino IDE?


I could compile the coding without any problems by choosing Arduino Board. Where is the problem from? The sketch file? The .cpp file or .h file?


Thank you for your response!


   


So after you included Arduino.h some of your compile errors were resolved - not all.

After you created a itoa.h file and routine, that error disappears.


But there is never any need to post 100+ compile errors - ever.

- the reason is only the first error has importance, it is where the compiling stopped.

- all other errors beneath it could have failed because first routine unavailable.

  why is it unavailable? 


By playing Sherlock Holmes, you have been given one very important clue. (many details)

 

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp: In member function 'uint16_t NexButton::getText(char*, uint16_t)':  


C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexButton.cpp:29:21: error: 'class String' has no member named 'c_str'


       sendCommand(cmd.c_str());

                       ^


That says in the NexButton::getText() function in file NexButton.cpp on line 29 at char pos 21 ... FAILED.

Why?  error: 'class String' has no member named 'c_str'

When did I use such String class?  sendCommand(cmd.c_str());


.. on to Part II in a moment.



1 person likes this

Now for Part II


Above you stated that you read some of the documentations

Above you stated that you can use Hardware Serial

But where is the problem?

Intel Edison is an x86 platform, Arduino grew from an AVR platform - extremely different.

   (Highly doubt there will ever be an AVR with 1M of sram let alone 1GB)

Intel Edison is indeed Arduino Certified.


I need to burst a myth ....

NO sensor or piece of Hardware (Nextion or other) supports "a platflorm" ... ever.

- support is what?  Is what I am doing now by answering your questions support?

- Actually, I am having a discussion in Free Chat. 

- Nextion does not support Intel ... but Intel supports Intel, Arduino supports Arduino.

- Nextion supports Nextion.


Nextion is a serial TTL device 5V idle high ... it accepts text commands.

-  Do you have the list of Text Commands?  It's the Nextion Instruction Set.

   - push the command page 2ÿÿÿ over serial at mutual baudrate - success. Change to page #2

   - baudrates on Nextion?  Nextion Instruction Set, System Variables: baud/bauds

     - it says valid baud rates are 2400,4800, 9600,19200,38400,57600 and 115200.

     - (extreme 3.686 Mbps that Edison can do is ... invalid - not a mutual baud rate)

So what does your documentation say about Arduino Board for Edison?

   - Can it do serial TTL?  The Arduino Board for Edison indeed boasts this capability.


Personally, I have not tried the Arduino Board, as stated earlier and elsewhere

 - Mini Breakout, more Linux bare metals, not via Arduino IDE

Will Nextion try out an Edison Arduino Board?  Most likely not.

 - There are literally 10,000+ MCU types, We will certainly not be trying to try them all.


The IteadLib Arduino Nextion Library is clearly stated in the readme.md

  - supports UNO and MEGA (both these are AVR)

But C code is C code, as an example it can be ported, the code is free.

It certainly provides a needed template.


The code libraries for Arduino AVR had to be programmed by someone

 - and they were programmed specifically with AVR in mind

 - the AVR dudes did not continue to keep programming for Mac, iOS, PIC etc.

But Intel Dudes did write a lot of code especially for their Arduino Certified platform


It is extremely important to dig into their code for Arduino,

It would be extremely important to dig up Edison Arduino UART Tutorials

 - https://communities.intel.com/thread/54236

This thread says Serial1 gives you access to the UART on pins 0 and 1


Consider that if Intel sold 1/2 million of those boards, their communities certainly know

and have many projects that have used the Edison board for Arduino.

But Nextion is Nextion support, Arduino is Arduino support, Intel is Intel support.

You will need to roll up your sleeves and dig into the documentation for Edison Libraries

You will need to find what functions are available, how to call them, what they are called.


Hope some of this is helpful.  There is a lot to digest with Edison


1 person likes this

Have a look in this directory or your local equivalent version...

C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\include

There should be a whole bunch of header files relating to the things that are throwing your errors.


e.g. string.h stdio.h etc.


Sometimes it is necessary to use in your sketch for example..


#include <string.h>


Which would solve the 'c_str()' error


More info here http://forum.arduino.cc/index.php?topic=95886.0


Follow Nick Gammons links it you need the files.




1 person likes this

@Rachael


I would like you to try something.

- Confirm that you have the v0.46 Nextion Editor

- Confirm your Edison Serial1 is valid  RX/TX as per your board

- Confirm Nextion 4.3" connect 5V 1A recommended power

   Nextion RX to Edison TX, Nextion TX to Edison RX, GND connected to GND


load a basic HMI (attached below) into Nextion Editor (eddy.HMI)

  build with the compile Button, upload to the Nextion Display (serial/microSD)

  - HMI contains two numbers n0 on left, n1 on right


A basic Arduino C++ sketch should show you have connection

 - this should alternate sending 123 and 456 between n0 and n1

 

int i = {0};

void setup(void) {
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop(void) {
   i=1-i; 
   if (i==0) {
     Serial1.print("n0.val=123ÿÿÿ");
     Serial1.print("n1.val=456ÿÿÿ");
   } else {
     Serial1.print("n0.val=456ÿÿÿ");
     Serial1.print("n1.val=123ÿÿÿ");
  }
  delay(1000);  
}

 So this should show Arduino Edison works with Nextion
- the rest is overcoming coding issues.

HMI
(7.18 KB)

1 person likes this

@Patrick 


Thank you for the sample coding. I had followed steps by steps but still i cant get any response from the screen.


image

Who at Intel has been answering your questions?

Hi Rachael!

Using Intel with Nextion is a great choice!

Firstly, everything is supposed to work normally, all you need is a bit of patience and perseverance.

I'd like to help you out and perhaps get an answer to a question that's been bugging me relating to Edison in the process.


First up, I can only see some of your wires on the photo. Are you sure that Edison and Nextion are connected correctly:

Edison's RX <-> Nextion's TX

Edison's TX <-> Nextion's RX

Edison provides the power supply so there can't be any problem with their ground.

Is your power supply 3.3 V or 5 V? Pick 5V for Nextion.


Concerning the nature of your issue: is the whole problem centered around a missing itoa function which you need but can't find?

Have you tested your Nextion display using the Nextion Editor and a USB/TTL adaptor?

Does the display work when you connect it to your computer and run the Nextion Editor debug mode?


PS Apologies in advance for not finding the time to read this long discussion and maybe subsequently missing the answers to these questions.

@Patrick 

I posted my question to Intel forum and now waiting their reply.


@Andrew

Hi Andrew, I am really glad you want to help. I think it is a great choice too. That's why i am trying hard to make it work. Have you been using edison with nextion?


Yes. I confirm i have connected them correctly. There are only 4 wires i used Nextion +5V to edison 5V, Nextion GND to Edison GND, Nextion TX to Edison RX and Nextion RX to Edison TX.


Yes, the problem can be itoa function as when i compile the coding by selecting edison in Arduino IDE the error " 'itoa' was not declared in this scope". However, if i compile the same coding by selecting arduino board, it can successful. I solved the itoa error by include "itoa.h". But there come another errors 'utoa was not declared in this scope' and 'class String has no member named 'c_str'. 


I haven't test my nextion display using Nextion Editor and a USB/TTL adaptor. Tomorrow i will get and adaptor and do the testing. I usually use a microSD card to upload the tft file to nextion lcd. About running Nextion Editor debug mode, i choose Send command to: Simulator and Nextion Device, when i click Connect it doesn't Disconnect (means that connection failed). Besides, when i try upload to the page to Nextion device through Editor, it showed me connection failed (Please refer to attach file). On the hardware part, i don't mistake on wire connection. What would be the possible mistake that make my edison and nextion fail to communicate?


Thank you for your concern.

image


When i try to upload or connect, it always show connection failed or never connect. 


Concerning itoa: as an idea, it's easier to write your own version of it, which you could then use in any future projects. It'll just be a couple dozen lines of code. If you find it difficult, I could explain how you could realize it in more detail - it's easy as pie.


If I understood you right, you said that you don't currently have a TTL adapter, so that would mean that you're trying to execute something in Nextion Editor's debug mode without having connected your display to your computer, which throws a "unable to connect" error.

Naturally this would be the case since you don't have any physical connection between your Nextion device and your computer. Am I on the right track here?

Login or Signup to post a comment