Connection through SIM7020E and NB-IOT

Hi there,

The root purpose of my project is to transfer data to Blynk using a modem SIM7020E and NB-IOT network.
Therefore I adapted the fantastic TinyGSM library to working with modem SIM7020E and features TCP App, TLS …

But i have facing a strange Blynk behavior using TLS connection to
Connection is success but app receiving from server reconnect message (29000100113133392E35392E3230362E313333003830 = BlynkCmd 41,
After that TLS connection cannot establish because port 80 is assigned instead of 443.

Why server trying to redirect client to unsecured connection? Could this be related with high latencies and low speed in NB-IOT networks?

As a work around can use connection to instead of, in this case, the redirect does not occur

I have read a little blynk-local’s code and now understand why it happens

protected void channelRead0(ChannelHandlerContext ctx, LoginMessage message) {
        String token = message.body.trim();
        TokenValue tokenValue = holder.tokenManager.getTokenValueByToken(token);

        if (tokenValue == null) {
            //token should always be 32 chars and shouldn't contain invalid nil char
            if (token.length() != 32 || token.contains(StringUtils.BODY_SEPARATOR_STRING)) {
                log.debug("HardwareLogic token is invalid. Token '{}', '{}'", token,;
                ctx.writeAndFlush(invalidToken(, ctx.voidPromise());
            } else {
                //no user on current server, trying to find server that user belongs to.
                checkTokenOnOtherServer(ctx, token,;

NB-IOT modem and WiFi network that was used to register the token has a different DNS response



╚ь :

NB-IOT modem:


+CDNSGIP: 1,“”,“”

There are three Blynk cloud servers (as far as I know) and a project and its associated auth code can only exist on one of these servers. is the Europe server and is the Asia server.

Normally, if you’re in a location where the app or device tries to connect to the local server but that’s not the one where your project lives then it does some clever redirection in the background, but that’s not working for you.

I guess that leaving the IP address hard-coded is the simplest solution, as this is what needs to happen for services such as IFTTT, so the IP address inst likely to change any time soon.


I have been searching for a long time and have not found the sim7020 library that can be used under blynk? Can you provide the address?