# Error while using the uart library

**URL:** <https://forum.xod.io/t/error-while-using-the-uart-library/2690>\
**Category:** Uncategorized\
**Created:** [October 14, 2019, 2:27am UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690 "2019-10-14T02:27:12Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![quang-huy](https://avatars.discourse-cdn.com/v4/letter/q/8baadc/32.png) [@quang-huy](https://forum.xod.io/u/quang-huy)\
**Post date:** [October 14, 2019, 2:27am UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/1 "2019-10-14T02:27:12Z")

</div>

![Screenshot%20from%202019-10-14%2009-05-282222](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/d/dac04b008607a812d75079697fadc209ec1d4864.png) ![Screenshot%20from%202019-10-14%2009-05-31222](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/d/d789f47575bb29da628416be3e0c65c2ae1bf3ab.png)

 ![Screenshot%20from%202019-10-14%2009-05-28](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/6/6da7cec92c586ada2815ec4365387cf10bba006e.png)

I’m trying to create a GSM patch but XOD keep throwing me errors. Can anyone help? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [October 14, 2019, 2:32am UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/2 "2019-10-14T02:32:32Z")

</div>

We aren’t likely to be able to help without knowing what the errors are…

---

<div class="post-metadata">

**Author:** ![quang-huy](https://avatars.discourse-cdn.com/v4/letter/q/8baadc/32.png) [@quang-huy](https://forum.xod.io/u/quang-huy)\
**Post date:** [October 14, 2019, 3:06am UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/3 "2019-10-14T03:06:48Z")

</div>

This is the error:

Compilation failed  
Command `/opt/XOD\ IDE/resources/arduino-cli --config-file=/tmp/arduino-cli5xSgvD/.cli-config.yml compile --fqbn arduino:avr:nano:cpu=atmega328old --verbose /tmp/xod_temp_sketchbookpRxNSF/xod_1571018677266_sketch` failed with code 1  
The generated C++ code contains errors. It can be due to a bad node implementation or if your board is not compatible with XOD runtime code. The original compiler error message is above. Fix C++ errors to continue. If you believe it is a bug, report the problem to XOD developers.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [October 14, 2019, 4:52am UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/4 "2019-10-14T04:52:02Z")

</div>

look

> [@Powerful IoT Device Without Coding](https://forum.xod.io/t/powerful-iot-device-without-coding/2611):
>
> Greetings! Check out my new story on how to make a simple IoT device using XOD: And the new library for working with SIMCOM family modules: [https://xod.io/libs/gabbapeople/sim7020/](https://xod.io/libs/gabbapeople/sim7020/)

---

<div class="post-metadata">

**Author:** ![gabbapeople](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gabbapeople/32/1517_2.png) [@gabbapeople](https://forum.xod.io/u/gabbapeople)\
**Post date:** [October 14, 2019, 10:30am UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/5 "2019-10-14T10:30:13Z")

</div>

I’ve been summoned [quang-huy](https://forum.xod.io/u/quang-huy)!

Apparently that you’re trying to send SMS text message to a mobile phone. I have not tried but the sequence of commands seems clear. Try to use the `gabbapeople/sim7020` library:

1. Set sending to the text mode.

```auto
AT+CMGF=1

```

1. Module answers `OK`
2. Send SMS to the mobile number.

```auto
AT+CMGS="+85291234567"

```

1. Module answers `>`
2. Enter msg and the terminal sequence `^Z` to to send a message.

```auto
HELLO WORLD!!! ^Z 

```

1. Module answers `OK` and additional `+` system info msg.

The patch looks something like this:

 ![2](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/4/420563a144c3c3964988c9c1a9e0686c50d1135f.png)

---

<div class="post-metadata">

**Author:** ![quang-huy](https://avatars.discourse-cdn.com/v4/letter/q/8baadc/32.png) [@quang-huy](https://forum.xod.io/u/quang-huy)\
**Post date:** [October 14, 2019, 12:04pm UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/6 "2019-10-14T12:04:15Z")

</div>

Thanks a lot gabbapeople!  
I have tried your patch, although I still got this error:

Compilation failed  
Command `/opt/XOD\ IDE/resources/arduino-cli --config-file=/tmp/arduino-clibKNpAY/.cli-config.yml compile --fqbn arduino:avr:nano:cpu=atmega328old --verbose /tmp/xod_temp_sketchbook37lrDS/xod_1571054199034_sketch` failed with code 1  
The generated C++ code contains errors. It can be due to a bad node implementation or if your board is not compatible with XOD runtime code. The original compiler error message is above. Fix C++ errors to continue. If you believe it is a bug, report the problem to XOD developers.

If you have some time to spill, here is my project file:  
[Mai1 (1).xodball](https://forum.xod.io/uploads/short-url/qjHV1mgOIduvMOwL3vfRz8D7sjI.xodball) (48.2 KB)

Can you compile it to test out if my error is Machine based or not?

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [October 14, 2019, 12:24pm UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/7 "2019-10-14T12:24:21Z")

</div>

> [@quang-huy](#):
>
> The original compiler error message is above.

You are only posting the last part that doesn’t include the actual error message. You need to scroll up to see the original error message.

---

<div class="post-metadata">

**Author:** ![gabbapeople](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gabbapeople/32/1517_2.png) [@gabbapeople](https://forum.xod.io/u/gabbapeople)\
**Post date:** [October 14, 2019, 12:30pm UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/8 "2019-10-14T12:30:35Z")

</div>

Which patch exactly do you want to test?  
That one that is stored at you xodball `Mai1 (1).xodball` with the `sms` name cannot be compiled as it is absolutely not finished.  
Try to assemble the patch from the screenshot that I attached and compile it.

---

<div class="post-metadata">

**Author:** ![quang-huy](https://avatars.discourse-cdn.com/v4/letter/q/8baadc/32.png) [@quang-huy](https://forum.xod.io/u/quang-huy)\
**Post date:** [October 14, 2019, 2:06pm UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/9 "2019-10-14T14:06:34Z")

</div>

Here it is:

Begin compiling code for the board Arduino Nano 📦

Using board ‘nano’ from platform in folder: /home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21  
Using core ‘arduino’ from platform in folder: /home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21

Detecting libraries used…

/home/lehuy/xod/ **packages** /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF\_CPU=16000000L -DARDUINO=10607 -DARDUINO\_AVR\_NANO -DARDUINO\_ARCH\_AVR -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs /tmp/arduino-sketch-4C0C5587BED25E0D62A8BC9E55921DEF/sketch/xod\_1571061876490\_sketch.ino.cpp -o /dev/null

Alternatives for Wire.h: [Wire@1.0]  
ResolveLibrary(Wire.h)  
-\> candidates: [Wire@1.0]

/home/lehuy/xod/ **packages** /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF\_CPU=16000000L -DARDUINO=10607 -DARDUINO\_AVR\_NANO -DARDUINO\_ARCH\_AVR -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src /tmp/arduino-sketch-4C0C5587BED25E0D62A8BC9E55921DEF/sketch/xod\_1571061876490\_sketch.ino.cpp -o /dev/null

Alternatives for LiquidCrystal\_I2C.h: [LiquidCrystal\_I2C]  
ResolveLibrary(LiquidCrystal\_I2C.h)  
-\> candidates: [LiquidCrystal\_I2C]

/home/lehuy/xod/ **packages** /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF\_CPU=16000000L -DARDUINO=10607 -DARDUINO\_AVR\_NANO -DARDUINO\_ARCH\_AVR -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C /tmp/arduino-sketch-4C0C5587BED25E0D62A8BC9E55921DEF/sketch/xod\_1571061876490\_sketch.ino.cpp -o /dev/null

Alternatives for LiquidCrystal.h: [LiquidCrystal@1.0.4]  
ResolveLibrary(LiquidCrystal.h)  
-\> candidates: [LiquidCrystal@1.0.4]

/home/lehuy/xod/ **packages** /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF\_CPU=16000000L -DARDUINO=10607 -DARDUINO\_AVR\_NANO -DARDUINO\_ARCH\_AVR -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal/src /tmp/arduino-sketch-4C0C5587BED25E0D62A8BC9E55921DEF/sketch/xod\_1571061876490\_sketch.ino.cpp -o /dev/null

/home/lehuy/xod/ **packages** /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF\_CPU=16000000L -DARDUINO=10607 -DARDUINO\_AVR\_NANO -DARDUINO\_ARCH\_AVR -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal/src /home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src/Wire.cpp -o /dev/null

/home/lehuy/xod/ **packages** /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF\_CPU=16000000L -DARDUINO=10607 -DARDUINO\_AVR\_NANO -DARDUINO\_ARCH\_AVR -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal/src /home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src/utility/twi.c -o /dev/null

/home/lehuy/xod/ **packages** /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF\_CPU=16000000L -DARDUINO=10607 -DARDUINO\_AVR\_NANO -DARDUINO\_ARCH\_AVR -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal/src /tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C/LiquidCrystal\_I2C.cpp -o /dev/null

/home/lehuy/xod/ **packages** /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF\_CPU=16000000L -DARDUINO=10607 -DARDUINO\_AVR\_NANO -DARDUINO\_ARCH\_AVR -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal/src /tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal/src/LiquidCrystal.cpp -o /dev/null

Generating function prototypes…

/home/lehuy/xod/ **packages** /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF\_CPU=16000000L -DARDUINO=10607 -DARDUINO\_AVR\_NANO -DARDUINO\_ARCH\_AVR -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal/src /tmp/arduino-sketch-4C0C5587BED25E0D62A8BC9E55921DEF/sketch/xod\_1571061876490\_sketch.ino.cpp -o /tmp/arduino-sketch-4C0C5587BED25E0D62A8BC9E55921DEF/preproc/ctags\_target\_for\_gcc\_minus\_e.cpp

/home/lehuy/xod/ **packages** /packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c+±kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino-sketch-4C0C5587BED25E0D62A8BC9E55921DEF/preproc/ctags\_target\_for\_gcc\_minus\_e.cpp

Compiling sketch…

/home/lehuy/xod/ **packages** /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF\_CPU=16000000L -DARDUINO=10607 -DARDUINO\_AVR\_NANO -DARDUINO\_ARCH\_AVR -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs -I/home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire/src -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C -I/tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal/src /tmp/arduino-sketch-4C0C5587BED25E0D62A8BC9E55921DEF/sketch/xod\_1571061876490\_sketch.ino.cpp -o /tmp/arduino-sketch-4C0C5587BED25E0D62A8BC9E55921DEF/sketch/xod\_1571061876490\_sketch.ino.cpp.o

/tmp/xod\_temp\_sketchbook37lrDS/xod\_1571061876490\_sketch/xod\_1571061876490\_sketch.ino: In function ‘void xod::xod\_\_uart\_\_uart\_1::evaluate(xod::xod\_\_uart\_\_uart\_1::Context)’:  
/tmp/xod\_temp\_sketchbook37lrDS/xod\_1571061876490\_sketch/xod\_1571061876490\_sketch.ino:3770:53: error: ‘Serial1’ was not declared in this scope  
state-\>uart = new (state-\>mem) HardwareUart(Serial1, (uint32\_t)getValue\<input\_BAUD\>(ctx));  
^

Multiple libraries were found for “Wire.h”  
Used: /home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire  
Multiple libraries were found for “LiquidCrystal\_I2C.h”  
Used: /tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C  
Multiple libraries were found for “LiquidCrystal.h”  
Used: /tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal

Using library Wire at version 1.0 in folder: /home/lehuy/xod/ **packages** /packages/arduino/hardware/avr/1.6.21/libraries/Wire  
Using library LiquidCrystal\_I2C in folder: /tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal\_I2C (legacy)  
Using library LiquidCrystal at version 1.0.4 in folder: /tmp/xod\_temp\_sketchbook37lrDS/libraries/LiquidCrystal

Error: exit status 1  
Compilation failed.  
Compilation failed  
Command `/opt/XOD\ IDE/resources/arduino-cli --config-file=/tmp/arduino-clibKNpAY/.cli-config.yml compile --fqbn arduino:avr:nano:cpu=atmega328old --verbose /tmp/xod_temp_sketchbook37lrDS/xod_1571061876490_sketch` failed with code 1  
The generated C++ code contains errors. It can be due to a bad node implementation or if your board is not compatible with XOD runtime code. The original compiler error message is above. Fix C++ errors to continue. If you believe it is a bug, report the problem to XOD developers.

---

<div class="post-metadata">

**Author:** ![quang-huy](https://avatars.discourse-cdn.com/v4/letter/q/8baadc/32.png) [@quang-huy](https://forum.xod.io/u/quang-huy)\
**Post date:** [October 14, 2019, 2:40pm UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/10 "2019-10-14T14:40:51Z")

</div>

I have recreate that exactly and get an error about Serial1 not being declared, I’m starting to wondering that instead of uart-1 I should have use uart-soft because that’s how I understand it to work with TX, RX and all of that good stuff.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [October 14, 2019, 3:35pm UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/11 "2019-10-14T15:35:13Z")

</div>

> [@quang-huy](#):
>
> ‘Serial1’ was not declared in this scope  
> state-\>uart = new (state-\>mem) HardwareUart(Serial1, (uint32\_t)getValue\<input\_BAUD\>(ctx));

the error is here in Serial1

---

<div class="post-metadata">

**Author:** ![gabbapeople](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gabbapeople/32/1517_2.png) [@gabbapeople](https://forum.xod.io/u/gabbapeople)\
**Post date:** [October 14, 2019, 3:41pm UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/12 "2019-10-14T15:41:41Z")

</div>

Yep, there is an error compiling for Arduino Nano because Nano do Not has **Hardware** UART interface named `serial1` only just `serial`.

The screenshot is just an example.

Make a new **Software** UART connection.  
Wire your module to another board pins, use the `soft-uart` node and leave `serial` **Hardware** interface for debugging only.

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [October 14, 2019, 3:54pm UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/13 "2019-10-14T15:54:32Z")

</div>

> [@quang-huy](#):
>
> /tmp/xod\_temp\_sketchbook37lrDS/xod\_1571061876490\_sketch/xod\_1571061876490\_sketch.ino: In function ‘void xod::xod\_\_uart\_\_uart\_1::evaluate(xod::xod\_\_uart\_\_uart\_1::Context)’:  
> /tmp/xod\_temp\_sketchbook37lrDS/xod\_1571061876490\_sketch/xod\_1571061876490\_sketch.ino:3770:53: error: ‘Serial1’ was not declared in this scope  
> state-\>uart = new (state-\>mem) HardwareUart(Serial1, (uint32\_t)getValue\<input\_BAUD\>(ctx));

This is the only error I see. Very likely it is related to gabbapeople’s comment that the patch is not finished.

---

<div class="post-metadata">

**Author:** ![quang-huy](https://avatars.discourse-cdn.com/v4/letter/q/8baadc/32.png) [@quang-huy](https://forum.xod.io/u/quang-huy)\
**Post date:** [October 15, 2019, 12:12am UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/14 "2019-10-15T00:12:20Z")

</div>

Yeah, here is my final patch:

 ![Screenshot%20from%202019-10-15%2007-04-00](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/d/ddbf2939ea3872379d730cb92eac7827f4e72904.png)

It did compile, which is a good start, but nothing happen, I’ve read somewhere that the TX and RX of soft-uart are backwards, tried that, uploaded some example code in C, it worked, so my board is not broken.  
Is there anyway that I can debug it like write something on the serial monitor?

---

<div class="post-metadata">

**Author:** ![gabbapeople](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gabbapeople/32/1517_2.png) [@gabbapeople](https://forum.xod.io/u/gabbapeople)\
**Post date:** [October 15, 2019, 3:01pm UTC](https://forum.xod.io/t/error-while-using-the-uart-library/2690/15 "2019-10-15T15:01:57Z")

</div>

Summoning, [quang-huy](https://forum.xod.io/t/error-while-using-the-uart-library/2690/14)!

I’ve made some improvements in the [gabbapeople/sim7020](https://xod.io/libs/gabbapeople/sim7020/) specially for you.  
Look for a few new nodes and the example patch `example-send-sms` to send SMS by pressing a `button`.

Tested it using: Arduino Uno, SIM800C, Software UART.

Patch:

 ![4](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/0/052fd3149b1aa555d4b6beb617a0b91836077c79.png)

Debug:

 ![33](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/6/643e56182996ce6b589f09cbeba73b25daea95ee.png)

Hardware:

 ![Hf4ZzDf9EaM](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/1/1ea92d8b27e259fc4ea29bb38f2469cd003b0e11.jpeg)

Result:

 ![photo_2019-10-15_18-00-48](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/5/53047dce83f56eab1023884422fa6fcf6219afcf.jpeg)

Try it!
