REXDESKREXGEN AirCloud

REXGEN Air: uploading logs to Amazon S3

Updated

Set up an Amazon S3 bucket and a scoped access key. Then give REXGEN Air the S3 settings and enable upload, so every log reaches your bucket over LTE.

Before you start, the logger needs a SIM, an LTE antenna and mobile settings. See REXGEN Air: choosing and setting up cloud upload. Amazon S3 stores each file as an object in a bucket, and you pay AWS only for the storage and transfer you use. The AWS console changes often, so these steps name the controls instead of showing screenshots.

Create a bucket

  1. Sign in to AWS. If you do not have an account, sign up at aws.amazon.com. Sign-up creates a root user with access to everything. As a security best practice, give administrative access to an administrative user. Keep the root user for the tasks that need it.
  2. Open the S3 console. Under Services, select Storage and then S3.
  3. Start a new bucket. Select Create bucket.
  4. Name the bucket. The name must follow the AWS bucket naming rules. Choose its region, for example Europe (London) eu-west-2. Use the region where you plan to run the conversion function in the next guide.
  5. Create the bucket. Complete the other fields as you need, then select Create bucket. The bucket appears in the Buckets list.

Create a user and an access key for the logger

The logger signs in to S3 with an access key that belongs to an IAM user. Give that user access to your logger bucket and nothing else.

  1. Open the IAM console. Under Services, open IAM (Identity and Access Management).
  2. Create the user. Under Access management, select Users and then Create user. Enter a user name and select Next.
  3. Attach a policy for the bucket. Select Attach policies directly and then Create policy. Select the JSON tab in the policy editor and paste the example policy after these steps. Replace your-bucket with your bucket name. Save the policy and attach it to the user.
  4. Confirm the user. Review the details and select Create user.
  5. Create the access key. Open the user and select Security credentials. Under Access keys, select Create access key. Select Other, read the best practice advice and select Next. Add a description tag and select Create access key.
  6. Store both keys securely. AWS shows the secret access key only once. Copy the access key and the secret access key to a password manager, then select Done.
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:*"],
      "Resource": [
        "arn:aws:s3:::your-bucket",
        "arn:aws:s3:::your-bucket/*"
      ]
    }
  ]
}

This policy limits the user to one bucket and its objects. It does not apply to any other bucket or AWS service. Within the bucket, it still allows every S3 action. Once you know which actions your setup uses, narrow the list, for example to s3:PutObject, s3:GetObject and s3:ListBucket.

Which identity needs which access AWS · PERMISSIONS Which identity needs which access Identity Your logger bucket CloudWatch logs Glue catalog Athena Logger IAM user This bucket and its objects only Lambda function IAM role Read RXD and DBC files, write the outputs Write its logs Glue job IAM role List, read and tag the Parquet files Write tables Grafana IAM user Read; read and write a query-results folder, such as queries/ Read Run queries Blank cells need no access. The guides attach AWSLambdaBasicExecutionRole for the function's logs and AWSGlueServiceRole for the Glue job. Add Amazon Timestream access to the Lambda role only if you enable that output. The logger's example policy allows every S3 action on its one bucket: narrow it once you know which actions your set-up uses.

Add the S3 settings in REXDESK

  1. Create an S3 setting. Select Tools > Cloud Settings, select the S3 tab and select New S3.
  2. Set the region. Select the Region of your bucket.
  3. Set the S3 type to AWS. Compatible is for other services that offer the S3 API.
  4. Use an SSL connection. Set the connection type to SSL (HTTPS) and add the certificate to the XML configuration. Plain sends the keys and files unencrypted over HTTP, so do not use it over the internet.
  5. Set the port. Enter 443 for SSL or 80 for Plain.
  6. Enter the bucket and keys. Enter the bucket name, the access key and the secret key, then select OK. The new setting appears in the list. Close the window.

For every field in the window, see REXDESK: upload logs to AWS S3, MinIO or Google Cloud Storage.

Enable upload in the configuration

  1. Prepare the configuration. Set up the channels you want to record.
  2. Enable AWS upload. In the Device Configuration window, select the Upload tab and tick Enable AWS.
  3. Select the S3 and mobile settings. If you have one setting of each kind, REXDESK fills them in. If you have several, select them from the drop-down lists.
  4. Set the check intervals. Enter the Configuration Check Time, Status Send Time and Firmware Check Time. The default shown is 300 seconds.
  5. Send the configuration. Select Run on the toolbar and save the project. Save project lets you name it. Continue as New Project saves it as "New Project". When the configuration has uploaded, select OK.
  6. Format the internal storage. Do this after you send a configuration with S3 upload enabled.
  7. Disconnect the USB cable. The logger connects to the server only when USB is disconnected.

Watch: Set up AWS settings with REXGEN (1:19)

Find the logs in your bucket

Each logger writes to its own folder, named after the logger. Inside it, one sub-folder for each day of logging holds the RXD files. The logger also writes its Status.json file to this folder and, when configured, its snapshot file.

What sits where in the bucket REXGEN AIR · S3 BUCKET What sits where in the bucket Name Put there by What it is your-bucket/ You The S3 bucket FileConvert.json You Conversion settings, bucket root REX04_A1_B007_SN000xxxx/ Logger One folder per logger, named after it Status.json Logger The logger's state <snapshot>.json Logger Snapshot file, when configured dbc_can0.dbc to dbc_can3.dbc You One DBC file per CAN bus config.rxc You A new configuration, over the air YYYYMMDD/ Logger One folder per recording day *.rxd Logger The RXD logs Parquet/ Lambda function Converted outputs, such as Parquet YYYYMMDD/ Logger The next recording day The logger creates and names its own folder (REX04_A1_B007_SN000xxxx is the guides' example). config.rxc goes in the logger's root folder, not in a date folder. Older conversion functions read a single ExportDBC.dbc instead of one DBC file per bus.
  • To send a new configuration over the air, place a config.rxc file where the logger looks for it. See REXDESK: send a new configuration over the air.
  • To convert each new log automatically, put the conversion settings file at the bucket root and the DBC files in the logger's folder. The next guide covers this.

Next: REXGEN Air: converting logs automatically with AWS Lambda.

Products in this guide

REXDESK

Logger setup & data export

View REXDESK Ask an engineer

REXGEN Air

CAN to cloud

View REXGEN Air Ask an engineer

Still stuck?

Our engineers answer support questions on every Influx Technology product.