Monthly Archives: June 2021

Free Online Tools or Software for Electronic Circuit Simulation

https://www.circuitlab.com/
Though free but only a few tries for each session. Not much useful.

https://www.multisim.com/
This is good. So  far I have used for simulating small sections like filters, transistor amplifiers etc. The free version served the purpose.

https://www.falstad.com/mathphysics.html
Various Simulation tools are there. Yet to explore much.

Please note – The information provided here is on as is basis. I don’t guarantee their accuracy and proper functioning.

JSON for Creating Paypal Subscription Plan

Hope this save some time for someone.

The concept is for each products there will be one or more subscription plan. End users will be presented with the Subscription plans. And they will buy the subscription.

The subscription plans can be created from both Paypal Dashboard and using REST API. Here is the REST API method.

Request URL
https://api-m.paypal.com/v1/billing/plans/

Method
Post

Header
Authorization:  Bearer A3xxxxxxxxxxr-LXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXcOFiuF7__PXXXXXXXXXXXXX_YuJNIHYHGTJG
PayPal-Request-Id: TEST-REQ-ID-12345       —-  This is optional. Passing this will make consequent requests work on same initial Request. Better to omit it.

BODY

{
  "product_id": "PRODCUCT ID OF CORRESPONDING PRODUCT",
  "name": "THE NAME of Subscription Plan GOES HERE",
  "description": "THE DESCRIPTION Subscription Plan GOES HERE",
  "billing_cycles": [
    {
      "frequency": {
        "interval_unit": "MONTH",
        "interval_count": 1
      },
      "tenure_type": "REGULAR",
      "sequence": 1,    //sequence is important when there are trials. Trials will be 1 and regular packages can be 2 onwards.
      "total_cycles": 0,  // 0 means unlimited
      "pricing_scheme": {
        "fixed_price": {
          "value": "1.99",
          "currency_code": "USD"
        }
      }
    }
  ],
  "payment_preferences": {
    "auto_bill_outstanding": true,
    "setup_fee": {
      "value": "0",
      "currency_code": "USD"
    },
    "setup_fee_failure_action": "CONTINUE",
    "payment_failure_threshold": 1
  },
  "taxes": {
    "percentage": "0",
    "inclusive": false
  }
}

Return

This will return the auto-generated Plan-ID. The plan id will be needed for integration in frontend.
The Plan-ID can also be found from the Paypal Dashboard's subscription section.

 

How to get Token with Paypal Rest API

How to create products with Paypal Rest API

Paypal REST API create products

Request URL
https://api-m.paypal.com/v1/catalogs/products

Method: Post

Header
Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  // xxxxxxxxxxxxxxxx  is base64 encoded Client ID:Secret  // base64_encode(client_id_string:client_secret_string) – note the colon in between
PayPal-Request-Id:TEST-REQ-ID-12345       —-  This is optional. Passing this will make consequent requests work on same initial Request. Better to omit it.

Body

{
  "id": "YOUR OWN PRODUCT ID",
  "name": "NAME",
  "status": "ACTIVE",
  "description": "DESCRIPTION GOES HERE",
  "type":"DIGITAL", //SUITABLE TYPE
  "category":"SOFTWARE",  //SUITABLE CATEGORY
  "home_url":"YOUR WEBSITE PAGE - WHERE DETAILS OF PRODUCT IS THERE"
}

Return
The call will return the same details on success

Paypal REST API get token

Request URL
https://api-m.paypal.com/v1/oauth2/token

Method
Post

Headers
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  // xxxxxxxxxxxxxxxx  is base64 encoded Client ID:Secret  // base64_encode(client_id_string:client_secret_string) – note the colon in between

Body
grant_type:client_credentials

Return

{

"scope": "https://uri.paypal.com/services/invoicing https://uri.paypal.com/services/disputes/read-buyer https://uri.paypal.com/services/payments/realtimepayment https://uri.paypal.com/services/disputes/update-seller https://uri.paypal.com/services/payments/payment/authcapture openid https://uri.paypal.com/services/disputes/read-seller https://uri.paypal.com/services/payments/refund https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/payments/.* https://uri.paypal.com/payments/payouts https://api.paypal.com/v1/vault/credit-card/.* https://uri.paypal.com/services/subscriptions https://uri.paypal.com/services/applications/webhooks",
"access_token": "AYYYYYYYYYYWmTopNAjV__Yuk_6AP9RZWQpzxxxxxxxxxxxxxx1ifvHLHrE6RW_Zqjbieo3jcZr9999999999999999lyDA",
"token_type": "Bearer",
"app_id": "APP-XYXYXYXYXYXYCCCC",
"expires_in": 32400,
"nonce": "2021-06-18T16:42:YUKJUKJHTGTYJKHGRRFHFHFGFGBFBG-spy-N9iguUHTJbTgVjht"

}
esp8266-esp-01-wifi-module-for-iot

ESP-01 Flashing Errors

After a few years I started working with an ESP-01 again. But after so many years I forgot the exact parameters of module I have and was using default settings. For hours I couldn’t flash anything to it. Everytime flashing failed with one error or other. The most occurring errors are :

  1. Invalid (unsupported) command 0x8 
  2. Invalid head of packet (0x00)
  3. Invalid head of packet (0x0f)

The above problems can be due to two reasons mainly

  1. Wrong settings
  2. The module needs to be RESET to get the flashing started. The timing of pressing reset and time of holding it down is important. The RESET needs to be done after the Arduino IDE starts the flashing (…. progress bar). And the RESET will have to be hold low for  1 – 2 seconds.
  3. Inadequate power supply

Though many suggested that these errors are due to incompatible signal levels between Arduino and ESP but in my case it was not. Previously also I had successfully flashed without logic level converters.

Proper parameters for ESP-01. Please note Flash mode will need to be set as per the chip. Newer ones need DOUT specifically. Whereas the old ones work with both QIO and DOUT. Burning with wrong mode will result in a successful upload but the code will not work. 

Solar panel online calculators

Free Solar Panel Calculator and Solar Power Calculator

Solar Panel Output Calculator- Estimate the Real Energy You Can Get From Your Solar Panels

 

https://www.renogy.com/calculators#tab_solar-size

 

Kolkataonweb.com doesn’t have any affiliation to the above websites. Neither Kolkataonweb.com warranties or guarantees any calculations.  You may use them as a guide to calculate solar panel and battery sizes and wattages.