the first cheap chip supporting five
gigahertz wi-fi seems to be arduino
compatible
but is it any good
and which tricks do we need to know
or is it better to wait for the new
esp32
which should also support 5 gigahertz
wi-fi
let's test it out
and discover that the manufacturer
included a multi-level adventure game
free of charge
great youtubers here is the guy with a
swiss accent with a new episode and
fresh ideas around sensors and
microcontrollers
remember if you subscribe you will
always sit in the first row
the chip's name is rtl87
and it comes on a development port
similar to the ones we know from the
esp8266
or the esp32
the board contains a bw16 module a usb
to serial chip
a beefy but inefficient cjt 1117
regulator and a three color led
so the first question we have to answer
is
how does it compare with the esp8266
and the esp32
looking at the board's pins we see that
quite a few are named nc or not
connected
this is because the bw16 module only has
16 pins
where 13 are gpio pins
so it is comparable with the esp8266
not with the original esp32
and it has two mcus one compatible with
arm cortex m4f
and one with a low power m0 this seems
to be more like a single core esp32
but i did not find evidence that we can
use the m0 core
the m4 by the way is also used in the
black pill and is a quite fast processor
the bw16 module has a two megabyte flash
chip on board
smaller than the four megabyte of the
typical esp dev boards but sufficient
for our projects
it supports ble50 whereas the
esp8266 has no ble and the esp32 only
supports 4.2
however this does not matter too much
because the biggest advantage a longer
range of bla50
is not supported because the chip's
maximum output is only 7 dbm
ble50 needs 20 dbm for the long range 20
dbm is 100 milliwatts and 7 dbm is 5
milliwatts by the way
the most significant difference to the
esp chips is
the rtl chip supports 5 gigahertz wi-fi
in addition to 2.4 gigahertz of the esp
chips
this is the only essential difference in
my opinion
and it is vital because the 2.4
gigahertz band with its only three
non-overlapping channels often is
crowded
this can lead to unstable communication
you do not believe me
let's have a look at what signals are in
the air on the 2.4 gigahertz band i do
this in my basement in the countryside
where i do not receive a lot of traffic
from my neighbors and the band is
already quite used here you see the
overlapping channels by the way
can you imagine how this would look like
in a flat in a city
the five gigahertz network would also
offer more speed this is of no
importance for most of our iot
applications
so we know now when to use the new rtl
chip but can we really use it with the
arduino ide
and do we have to make compromises and
where
let's start with the blink sketch if
blink does not work we can stop and save
a lot of time fortunately realtek the
chip manufacturer created a page
particularly for this port and the
arduino ide
i start with a pin out arduino made that
one simple numbers from 0 to 12
even if internally the pins were called
differently
here they do not at all comply with this
schema
they call the pins p a x x and p b x x
and they have numbers up to 30. i
wouldn't say that i like that
in addition we find lp underscore as
well as lock underscore pins
now it starts to become confusing
the only pins i understand are ground
vcc
3.3 volt and chip enable
nc also seems to be clear not connected
till we have a closer look at the pcb
and find a connected nc pin
even more confusing
but this is not all if we look to the
top sales screen we find other pin
numbers ga gc and ge
what did the engineers think when they
did this
but not finished
if we scroll down we find another pin
numbering
gpioa underscore and
gpiob underscore
this one seems to be easy to decode if
we remove the g the io and the
underscore we get pa or pb from before
let's hope that they did not mix the
numbers
as with the
esp8266 we have dedicated pins for i
square c and spi and not variable ones
as with the esp32
one pin can be used as an adc input
as we also see that the chip has two
serial connections which in the future
will be more important than you think
because the engineers did not stop
confusing us with different pin naming
this would have been way too easy
they wanted to separate the chickens
from the brave
and here is how they did it
all dev boards i own and if you ask my
wife there are many of them
are programmed using the usb connector
only very few of them have two usb
connectors which then are labeled still
one of the two can be used for
programming
here it's different they suggest you to
connect four pins in this way before you
start programming
why is that
because they connected the second serial
connection to the usb chip not the one
needed for programming
so using usb for programming does not
work out of the box
an excellent idea if you want to prevent
people from using your chips
and what are these two wires for
they connect the two serial connections
in parallel
input to input is ok
but output to output
what do you have to expect if one serial
connection wants to have its output high
and the other low
let's hope that they disable one serial
during upload
i do not like such wiring and connect
the second serial called log underscore
rx and log underscore tx to an external
3.3 volt usb to serial adapter
so i can avoid those two wires
now we are in business
make a note on which com port is
connected to each serial you will need
it over and over again
it looks now that we have entered known
territories installing new boards in the
arduino ide we enter this string into
the preferences tab go to parts manager
search for ambia and install the boards
now we can select our
rtl8720 chip as usual
we only need to select the port for
uploading no other parameters to choose
from
unfortunately they did not send me into
this rat hole the installation of the
boards worked flawlessly
do you think they gave up and let us
program this chip after all the
confusion
of course not
they still suspect a few cowards amongst
us
that's why they built the next riddle
they probably feared that we lose
interest so they gave us a goodie and
included many examples for their chip
not all work as we later will see
the only one i want now is not here the
blink sketch
so i use the standard one it compiles
and starts to upload cool
the only thing not clear to me is this
countdown before the uploading maybe
james bond knows
he is good with timers at bombs
luckily no explosion just the next
surprise
even if i thought i used the correct com
port the upload fails
also with the other com port by the way
so we are at the next riddle
after searching
exchanging download with upload and
understanding what they wanted to tell
me i found the solution
the same procedure as always press the
burn and reset buttons and release the
reset before the burn button
now the
rtl8720 can be programmed
simple if you know how and really the
sketch is uploaded finally
did you think we are done
of course not
they still have one or two aces in their
sleeve the first is our sketch will not
start before we hit the reset button
also okay
but it still does not blink
and it shows this message after every
reset
so it seems that there is a firmware in
the chip waiting for at commands
i thought i replaced this firmware with
my sketch
interesting
and the terminal does not react to at
commands
what does this line mean
38400
comma eight comma one comma zero
i would say thirty eight thousand four
hundred port eight bits one stop bit no
parity
but serial runs on 115 200.
do you know the trick
the other serial connection is used for
the at commands
if we use putty and select 38400
we get a response to the 80 commands
very good
did you count how many riddles we
already solved
was this the last one
or can we expect more challenges for the
less than ten dollars we had to pay for
this adventure game
luckily they included a bonus level and
they wanted it to be the biggest of all
this is why they offer two possibilities
to solve it and present the more complex
one in the first place
that a simple guy like me easily falls
into the trap and loses another few
hours
in addition they added slightly wrong or
misleading information in the
description
they asked me to perform an over-the-air
update
i had to generate the right ota dot bin
file
connect the dev board and my pc to the
same wi-fi network start the update
server on port 8082
issue an at command and wait till things
are done
only to learn that they included a much
simpler method using serial
but they put it below the first
complicated method i used
do not think you did something wrong if
your terminal starts to beep and write
gibberish
just put your board into upload mode and
upload the blink sketch
after resetting the board the green led
blinks
and we reached the highest level of the
game
from now on it is easy
use the second serial port for uploading
and do not forget to press the two
buttons before uploading and the reset
button afterwards
maybe you are lucky and your board does
not contain firmware then you can skip a
few levels and after the connection of
the second serial go right to the
uploading of your sketch was it
worthwhile the effort
let's try to connect to my five
gigahertz network
it connects to my access point
at least something
but let's check if it really uses the
five gigahertz spectrum as before i use
this professional spectrum v6 to check
it out
and really we see a strong signal on
channel 40 which is a 20 megahertz
channel we see also that the 5 gigahertz
wi-fi offers a lot of channels and in my
case is still more or less free a
significant advantage over the 2.4
gigahertz band
we also see that serial.print uses the
com port of the usb connector serial one
writes to the programming port by the
way
and if you connect both you get some
information in parallel
next i want to try ble i create a
battery service
and a battery client it works one
rtl8720
can read the signals from the other one
and nrf connect also sees it
one application of the five gigahertz
range would be to use it as a presence
detector like in video 382
because most smartphones currently use
the five gigahertz network and were not
detected by the esp chips
unfortunately the approximate library
does not compile maybe david sees this
video and adapts it to the new chip
the next thing i wanted to test was deep
sleep the chip seems to offer such modes
and they include included four examples
unfortunately i was not able to get them
running the pin confusion continues here
because now they have introduced a new
numbering scheme again here they call
the pins
dxx this sleep mode would have been
handy to test the ble power consumption
where the esp32 chip did not perform at
all
maybe somebody knows and can create a
bubblefish translator for all the
different
rtl8720 pin names
so what is my verdict
if you need coverage of the five
gigahertz band this is the chip to go
with the tricks learned before it is
relatively simple to use it maybe you
are happy and your device does not come
with pre-installed firmware
if we get some enlightening on the pins
we even should be able to get deep sleep
working the rest is pretty much the same
as the esp chips and should work as
expected
if you need more pins you can have a
look at seed studio
they offer the big sister the rtl 87 22
with more pins
is it better to wait for the new esp32
i doubt it because i remember how long
we had to wait till the arduino ide
supported the dash s2 chip
of course we can hope for a faster
adoption but i tend to base my decisions
on experience rather than on hope
that was all for today as always you
find all the relevant links in the
description
i hope this video was useful or at least
interesting for you if true please
consider supporting the channel to
secure its future existence thank you
bye